Skip to content

Commit

Permalink
feat: change auto lock message and add TODO for function refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Pradip-p committed Aug 6, 2024
1 parent 64aa17f commit 5a68f4c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/backend/app/tasks/task_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,19 @@ async def new_event(

match detail.event:
case EventType.REQUESTS:
# TODO: Combine the logic of `update_or_create_task_state` and `request_mapping` functions into a single function if possible. Will do later.
project = await get_project_by_id(db, project_id)
if project['auto_lock_tasks'] == 'true':
print("auto lock")
data = await task_crud.update_or_create_task_state(
db,
project_id,
task_id,
user_id,
"Request accepted by auto",
"Request accepted automatically",
State.REQUEST_FOR_MAPPING,
State.LOCKED_FOR_MAPPING,
)
else:
print("manul lock..")
data = await task_crud.request_mapping(
db,
project_id,
Expand Down

0 comments on commit 5a68f4c

Please sign in to comment.