[WEB-3087] fix: handle cycle start and end timezone conversion in list, create, and update (#6366)

* chore: handled cycle start and start timezone conversion in list, create and update

* chore: yarn lock
This commit is contained in:
guru_sainath 2025-01-09 18:20:18 +05:30 committed by GitHub
parent add35b5ea6
commit 2ddd7096e4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 1 deletions

View file

@ -22,7 +22,7 @@ class CycleWriteSerializer(BaseSerializer):
):
project_id = (
self.initial_data.get("project_id", None)
or (self.instance and self.instance.get("project_id", None))
or (self.instance and self.instance.project_id)
or self.context.get("project_id", None)
)
is_start_date_end_date_equal = (

View file

@ -303,6 +303,11 @@ class CycleViewSet(BaseViewSet):
.first()
)
datetime_fields = ["start_date", "end_date"]
cycle = user_timezone_converter(
cycle, datetime_fields, request.user.user_timezone
)
# Send the model activity
model_activity.delay(
model_name="cycle",
@ -387,6 +392,11 @@ class CycleViewSet(BaseViewSet):
"created_by",
).first()
datetime_fields = ["start_date", "end_date"]
cycle = user_timezone_converter(
cycle, datetime_fields, request.user.user_timezone
)
# Send the model activity
model_activity.delay(
model_name="cycle",