[WEB-3786] fix: issue date update when converting when dates are passed as string for comparison #6880
for comparison
This commit is contained in:
parent
c3cfcc1b92
commit
543552f492
1 changed files with 9 additions and 0 deletions
|
|
@ -63,6 +63,7 @@ from plane.bgtasks.webhook_task import model_activity
|
||||||
from plane.bgtasks.issue_description_version_task import issue_description_version_task
|
from plane.bgtasks.issue_description_version_task import issue_description_version_task
|
||||||
from plane.utils.host import base_host
|
from plane.utils.host import base_host
|
||||||
|
|
||||||
|
|
||||||
class IssueListEndpoint(BaseAPIView):
|
class IssueListEndpoint(BaseAPIView):
|
||||||
@allow_permission([ROLE.ADMIN, ROLE.MEMBER, ROLE.GUEST])
|
@allow_permission([ROLE.ADMIN, ROLE.MEMBER, ROLE.GUEST])
|
||||||
def get(self, request, slug, project_id):
|
def get(self, request, slug, project_id):
|
||||||
|
|
@ -1034,9 +1035,17 @@ class IssueBulkUpdateDateEndpoint(BaseAPIView):
|
||||||
"""
|
"""
|
||||||
Validate that start date is before target date.
|
Validate that start date is before target date.
|
||||||
"""
|
"""
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
start = new_start or current_start
|
start = new_start or current_start
|
||||||
target = new_target or current_target
|
target = new_target or current_target
|
||||||
|
|
||||||
|
# Convert string dates to datetime objects if they're strings
|
||||||
|
if isinstance(start, str):
|
||||||
|
start = datetime.strptime(start, "%Y-%m-%d").date()
|
||||||
|
if isinstance(target, str):
|
||||||
|
target = datetime.strptime(target, "%Y-%m-%d").date()
|
||||||
|
|
||||||
if start and target and start > target:
|
if start and target and start > target:
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue