[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:
parent
add35b5ea6
commit
2ddd7096e4
2 changed files with 11 additions and 1 deletions
|
|
@ -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 = (
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue