Allow all models for reference if there is no restriction

If the allowed models is empty, it means that there is no constraint on the
reference model. So we must allow all of them.

issue8300
review275311002
This commit is contained in:
Cédric Krier committed 2019-04-26 12:04:10 +02:00
1 parent b45eef8885
commit e3ceba18c4
1 file changed
+1 -1
+1 -1
View File
@@ -93,7 +93,7 @@ class SelectionMixin(object):
def _model_evaluator(allowed_models):
def test(value):
return value[0] in allowed_models
return value[0] in allowed_models or not allowed_models
return test
if field.attrs['type'] == 'reference':