We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2286ab6 commit abe3edbCopy full SHA for abe3edb
netbox_custom_objects/models.py
@@ -1039,10 +1039,10 @@ def clean(self):
1039
}
1040
)
1041
1042
- # Uniqueness can not be enforced for boolean fields
1043
- if self.unique and self.type == CustomFieldTypeChoices.TYPE_BOOLEAN:
+ # Uniqueness can not be enforced for boolean or multiobject fields
+ if self.unique and self.type in [CustomFieldTypeChoices.TYPE_BOOLEAN, CustomFieldTypeChoices.TYPE_MULTIOBJECT]:
1044
raise ValidationError(
1045
- {"unique": _("Uniqueness cannot be enforced for boolean fields")}
+ {"unique": _("Uniqueness cannot be enforced for boolean or multiobject fields")}
1046
1047
1048
# Check if uniqueness constraint can be applied when changing from non-unique to unique
0 commit comments