Skip to content

Commit 7d485e8

Browse files
author
Jan Schrewe
committed
Inheritance without document now works.
1 parent 7f3493f commit 7d485e8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mongodbforms/documents.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ class ModelFormOptions(object):
195195
def __init__(self, options=None):
196196
self.document = getattr(options, 'document', None)
197197
self.model = self.document
198-
if isinstance(self.model._meta, dict):
198+
if self.model is not None and isinstance(self.model._meta, dict):
199199
self.model._admin_opts = AdminOptions(self.model)
200200
self.model._meta = self.model._admin_opts
201201
self.fields = getattr(options, 'fields', None)
@@ -219,7 +219,7 @@ def __new__(cls, name, bases, attrs):
219219

220220
if 'media' not in attrs:
221221
new_class.media = media_property(new_class)
222-
222+
223223
opts = new_class._meta = ModelFormOptions(getattr(new_class, 'Meta', None))
224224
if opts.document:
225225
formfield_generator = getattr(opts, 'formfield_generator', MongoFormFieldGenerator)

0 commit comments

Comments
 (0)