From 1d81557d7035818b6f69a59e25cefa32d14d4808 Mon Sep 17 00:00:00 2001 From: gurusinath Date: Thu, 9 Jan 2025 17:00:26 +0530 Subject: [PATCH 1/2] chore: handled cycle start and start timezone conversion in list, create and update --- apiserver/plane/app/serializers/cycle.py | 2 +- apiserver/plane/app/views/cycle/base.py | 10 ++++++++++ yarn.lock | 4 ++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/apiserver/plane/app/serializers/cycle.py b/apiserver/plane/app/serializers/cycle.py index efc0f8f8b2d..b56b0835058 100644 --- a/apiserver/plane/app/serializers/cycle.py +++ b/apiserver/plane/app/serializers/cycle.py @@ -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 = ( diff --git a/apiserver/plane/app/views/cycle/base.py b/apiserver/plane/app/views/cycle/base.py index ad13d5fe9ba..f30f498265f 100644 --- a/apiserver/plane/app/views/cycle/base.py +++ b/apiserver/plane/app/views/cycle/base.py @@ -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", @@ -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", diff --git a/yarn.lock b/yarn.lock index 3a69fe7332c..88cec15efa1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3576,7 +3576,11 @@ resolved "https://registry.yarnpkg.com/@tiptap/extension-underline/-/extension-underline-2.11.0.tgz#473025d3ed01953fb2c23f8060ea90be4c231faa" integrity sha512-DE1piq441y1+9Aj1pvvuq1dcc5B2HZ2d1SPtO4DTMjCxrhok12biTkMxxq0q1dzA5/BouLlUW6WTPpinhmrUWA== +<<<<<<< Updated upstream "@tiptap/html@2.11.0": +======= +"@tiptap/html@^2.1.13", "@tiptap/html@^2.3.0": +>>>>>>> Stashed changes version "2.11.0" resolved "https://registry.yarnpkg.com/@tiptap/html/-/html-2.11.0.tgz#dd0b4195a07bbdca27aa13325b8ebac41480a6a0" integrity sha512-9+8eSeey3gm6vMtbt+uKZfkvtwsWr577lhtTeGUsoThim9zyBnbhzHc1dQw2m1RefOoPcODrnnQPvi5nvA84Cw== From 5eda5d1c0de292f13268b576cc841134b3af2e20 Mon Sep 17 00:00:00 2001 From: gurusinath Date: Thu, 9 Jan 2025 17:05:46 +0530 Subject: [PATCH 2/2] chore: yarn lock --- yarn.lock | 4 ---- 1 file changed, 4 deletions(-) diff --git a/yarn.lock b/yarn.lock index 88cec15efa1..3a69fe7332c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3576,11 +3576,7 @@ resolved "https://registry.yarnpkg.com/@tiptap/extension-underline/-/extension-underline-2.11.0.tgz#473025d3ed01953fb2c23f8060ea90be4c231faa" integrity sha512-DE1piq441y1+9Aj1pvvuq1dcc5B2HZ2d1SPtO4DTMjCxrhok12biTkMxxq0q1dzA5/BouLlUW6WTPpinhmrUWA== -<<<<<<< Updated upstream "@tiptap/html@2.11.0": -======= -"@tiptap/html@^2.1.13", "@tiptap/html@^2.3.0": ->>>>>>> Stashed changes version "2.11.0" resolved "https://registry.yarnpkg.com/@tiptap/html/-/html-2.11.0.tgz#dd0b4195a07bbdca27aa13325b8ebac41480a6a0" integrity sha512-9+8eSeey3gm6vMtbt+uKZfkvtwsWr577lhtTeGUsoThim9zyBnbhzHc1dQw2m1RefOoPcODrnnQPvi5nvA84Cw==