mirror of
https://github.com/inventree/InvenTree.git
synced 2026-08-31 17:28:07 +00:00
Skip constraint checking in NoteSerializer
This commit is contained in:
@@ -878,6 +878,14 @@ class NoteSerializer(FilterableSerializerMixin, InvenTreeModelSerializer):
|
||||
|
||||
read_only_fields = ['updated', 'updated_by']
|
||||
|
||||
def get_unique_together_validators(self):
|
||||
"""Skip the auto-generated 'unique_primary_note_per_model' validator.
|
||||
|
||||
That constraint is deliberately enforced by Note.save() by demoting
|
||||
sibling notes, rather than rejecting requests that set 'primary'.
|
||||
"""
|
||||
return []
|
||||
|
||||
def validate(self, data):
|
||||
"""Validate note data — templates need no model_id; regular notes require both."""
|
||||
data = super().validate(data)
|
||||
|
||||
Reference in New Issue
Block a user