Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apiserver/plane/app/serializers/cycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def validate(self, data):
):
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 = (
Expand Down
10 changes: 10 additions & 0 deletions apiserver/plane/app/views/cycle/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,11 @@ def create(self, request, slug, project_id):
.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",
Expand Down Expand Up @@ -387,6 +392,11 @@ def partial_update(self, request, slug, project_id, pk):
"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",
Expand Down
Loading