[WEB-3044] fix: Correct handling of equal start and end dates in cycle create and update (#6328)

* chore: handled start and end date issue when user send the start and end date equal

* chore: updated variable name and comment

* chore: typo
This commit is contained in:
guru_sainath 2025-01-06 20:31:31 +05:30 committed by GitHub
parent d3d3bf79f9
commit 0cabde03f0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 47 additions and 14 deletions

View file

@ -21,11 +21,18 @@ class CycleWriteSerializer(BaseSerializer):
and data.get("end_date", None) is not None
):
project_id = self.initial_data.get("project_id") or self.instance.project_id
is_start_date_end_date_equal = (
True if data.get("start_date") == data.get("end_date") else False
)
data["start_date"] = convert_to_utc(
str(data.get("start_date").date()), project_id, is_start_date=True
date=str(data.get("start_date").date()),
project_id=project_id,
is_start_date=True,
)
data["end_date"] = convert_to_utc(
str(data.get("end_date", None).date()), project_id
date=str(data.get("end_date", None).date()),
project_id=project_id,
is_start_date_end_date_equal=is_start_date_end_date_equal,
)
return data