[WEB-3087] fix: project_id handling in cycle create write serializer (#6358)

* chore: handled cycle create write serailizer project_id current instance

* chore: updated instance validation in cycle write serializer
This commit is contained in:
guru_sainath 2025-01-09 16:23:53 +05:30 committed by GitHub
parent 8c57543f72
commit 448a34aa5f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 8 deletions

View file

@ -20,7 +20,11 @@ class CycleWriteSerializer(BaseSerializer):
data.get("start_date", None) is not None
and data.get("end_date", None) is not None
):
project_id = self.initial_data.get("project_id") or self.instance.project_id
project_id = (
self.initial_data.get("project_id", None)
or (self.instance and self.instance.get("project_id", None))
or self.context.get("project_id", None)
)
is_start_date_end_date_equal = (
True
if str(data.get("start_date")) == str(data.get("end_date"))