Browse Source

Bugfixe in leobject

Deleted hardcoded condition that brokes standart field validation process
Yann Weber 8 years ago
parent
commit
0aec7f6ca8

BIN
examples/em_test.pickle View File


+ 1
- 1
lodel/leapi/datahandlers/base_classes.py View File

@@ -192,7 +192,7 @@ class Reference(DataHandler):
192 192
     # @param internal bool : if False, the field is not internal
193 193
     # @param **kwargs : other arguments
194 194
     def __init__(self, allowed_classes = None, back_reference = None, internal=False, **kwargs):
195
-        self.__allowed_classes = [] if allowed_classes is None else set(allowed_classes)
195
+        self.__allowed_classes = set() if allowed_classes is None else set(allowed_classes)
196 196
         logger.warning("We're going to inialize an temporary attribute, don't forget to fix this issue")
197 197
         if back_reference is not None:
198 198
             if len(back_reference) != 2:

+ 1
- 1
lodel/leapi/leobject.py View File

@@ -499,7 +499,7 @@ DS_PLUGIN_NAME.DS_INSTANCE_NAME. But got %s" % ds_identifier)
499 499
         correct = set() #valid fields name
500 500
         mandatory = set() #mandatory fields name
501 501
         for fname, datahandler in cls._fields.items():
502
-            if allow_internal or not datahandler.is_internal() or fname == CLASS_ID_FIELDNAME:
502
+            if allow_internal or not datahandler.is_internal():
503 503
                 correct.add(fname)
504 504
                 if complete and not hasattr(datahandler, 'default'):
505 505
                     mandatory.add(fname)

BIN
tests/editorial_model.pickle View File


Loading…
Cancel
Save