mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
chore: edge case handling
This commit is contained in:
parent
0f13f7632e
commit
6bea6190b9
@ -405,5 +405,5 @@ class BulkArchiveIssuesEndpoint(BaseAPIView):
|
||||
|
||||
return Response(
|
||||
{"archived_at": str(timezone.now().date())},
|
||||
status=status.HTTP_204_NO_CONTENT,
|
||||
status=status.HTTP_200_OK,
|
||||
)
|
||||
|
@ -1,5 +1,6 @@
|
||||
# Python imports
|
||||
import json
|
||||
from datetime import datetime
|
||||
|
||||
# Django imports
|
||||
from django.utils import timezone
|
||||
@ -100,7 +101,13 @@ class BulkIssueOperationsEndpoint(BaseAPIView):
|
||||
|
||||
# Start date
|
||||
if properties.get("start_date", False):
|
||||
if issue.target_date < properties.get("start_date"):
|
||||
if (
|
||||
issue.target_date
|
||||
and issue.target_date
|
||||
<= datetime.strptime(
|
||||
properties.get("start_date"), "%Y-%m-%d"
|
||||
).date()
|
||||
):
|
||||
return Response(
|
||||
{
|
||||
"error_code": "4101",
|
||||
@ -127,7 +134,13 @@ class BulkIssueOperationsEndpoint(BaseAPIView):
|
||||
|
||||
# Target date
|
||||
if properties.get("target_date", False):
|
||||
if issue.start_date > properties.get("target_date"):
|
||||
if (
|
||||
issue.start_date
|
||||
and issue.start_date
|
||||
>= datetime.strptime(
|
||||
properties.get("target_date"), "%Y-%m-%d"
|
||||
).date()
|
||||
):
|
||||
return Response(
|
||||
{
|
||||
"error_code": "4102",
|
||||
|
Loading…
Reference in New Issue
Block a user