-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
status: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: housekeepingChanges to the application which do not directly impact the end userChanges to the application which do not directly impact the end user
Milestone
Description
Proposed Changes
Replace all instances of unique_together under a model Meta class with a list of UniqueConstraint instances defined under constraints. Additionally, and custom overrides of a model's validate_unique() method should be removed where possible.
Justification
UniqueConstraint was introduced in Django 4.0 and allows for conditional evaluation. This should allow us to ditch any custom validate_unique() logic, such as what is currently defined for the Device model. The Django docs also recommend moving away from unique_together in general as it will likely be deprecated in the future.
Metadata
Metadata
Assignees
Labels
status: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: housekeepingChanges to the application which do not directly impact the end userChanges to the application which do not directly impact the end user