[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:
parent
8c57543f72
commit
448a34aa5f
2 changed files with 12 additions and 8 deletions
|
|
@ -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"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue