fix: complaint API create — due_at no longer required (auto-calculated by model.save())
All checks were successful
Build and Push Docker Image / build (push) Successful in 2m5s

The ComplaintSerializer inherited 'required' for due_at from the model field
(not nullable at DB level), but the model's save() method auto-calculates
it via calculate_sla_due_date(). Added extra_kwargs = {'due_at': {'required': False}}
so API callers can omit it. Verified: POST without due_at returns 201 + reference.
This commit is contained in:
ismail 2026-06-18 22:47:52 +03:00
parent 8bcc2d598f
commit a19ffbf320

View File

@ -263,6 +263,9 @@ class ComplaintSerializer(serializers.ModelSerializer):
"created_at",
"updated_at",
]
extra_kwargs = {
"due_at": {"required": False},
}
def get_domain_details(self, obj):
"""Get domain details"""