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",