From a19ffbf320c4255023d54580717946dbd6472981 Mon Sep 17 00:00:00 2001 From: ismail Date: Thu, 18 Jun 2026 22:47:52 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20complaint=20API=20create=20=E2=80=94=20d?= =?UTF-8?q?ue=5Fat=20no=20longer=20required=20(auto-calculated=20by=20mode?= =?UTF-8?q?l.save())?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- apps/complaints/serializers.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/complaints/serializers.py b/apps/complaints/serializers.py index 0cb693d..3886875 100644 --- a/apps/complaints/serializers.py +++ b/apps/complaints/serializers.py @@ -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"""