Skip to content

Commit 2ddd709

Browse files
authored
[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
1 parent add35b5 commit 2ddd709

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

apiserver/plane/app/serializers/cycle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def validate(self, data):
2222
):
2323
project_id = (
2424
self.initial_data.get("project_id", None)
25-
or (self.instance and self.instance.get("project_id", None))
25+
or (self.instance and self.instance.project_id)
2626
or self.context.get("project_id", None)
2727
)
2828
is_start_date_end_date_equal = (

apiserver/plane/app/views/cycle/base.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,11 @@ def create(self, request, slug, project_id):
303303
.first()
304304
)
305305

306+
datetime_fields = ["start_date", "end_date"]
307+
cycle = user_timezone_converter(
308+
cycle, datetime_fields, request.user.user_timezone
309+
)
310+
306311
# Send the model activity
307312
model_activity.delay(
308313
model_name="cycle",
@@ -387,6 +392,11 @@ def partial_update(self, request, slug, project_id, pk):
387392
"created_by",
388393
).first()
389394

395+
datetime_fields = ["start_date", "end_date"]
396+
cycle = user_timezone_converter(
397+
cycle, datetime_fields, request.user.user_timezone
398+
)
399+
390400
# Send the model activity
391401
model_activity.delay(
392402
model_name="cycle",

0 commit comments

Comments
 (0)