Skip to content

Commit da1a7ab

Browse files
[GIT-221] fix(cycle): guard against no end_date when archiving cycle (#9200)
1 parent aacfaac commit da1a7ab

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

apps/api/plane/api/views/cycle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,7 @@ def post(self, request, slug, project_id, cycle_id):
813813
Only cycles that have ended can be archived.
814814
"""
815815
cycle = Cycle.objects.get(pk=cycle_id, project_id=project_id, workspace__slug=slug)
816-
if cycle.end_date >= timezone.now():
816+
if cycle.end_date is None or cycle.end_date >= timezone.now():
817817
return Response(
818818
{"error": "Only completed cycles can be archived"},
819819
status=status.HTTP_400_BAD_REQUEST,

apps/api/plane/app/views/cycle/archive.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ def get(self, request, slug, project_id, pk=None):
587587
def post(self, request, slug, project_id, cycle_id):
588588
cycle = Cycle.objects.get(pk=cycle_id, project_id=project_id, workspace__slug=slug)
589589

590-
if cycle.end_date >= timezone.now():
590+
if cycle.end_date is None or cycle.end_date >= timezone.now():
591591
return Response(
592592
{"error": "Only completed cycles can be archived"},
593593
status=status.HTTP_400_BAD_REQUEST,

0 commit comments

Comments
 (0)