Skip constraint checking in NoteSerializer

This commit is contained in:
Oliver Walters
2026-07-22 00:06:21 +00:00
parent 0538b12be1
commit b42bc955c1
@@ -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)