Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions netbox_custom_objects/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1039,10 +1039,10 @@ def clean(self):
}
)

# Uniqueness can not be enforced for boolean fields
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]:
raise ValidationError(
{"unique": _("Uniqueness cannot be enforced for boolean fields")}
{"unique": _("Uniqueness cannot be enforced for boolean or multiobject fields")}
)

# Check if uniqueness constraint can be applied when changing from non-unique to unique
Expand Down