Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New endpoints #4

Draft
wants to merge 16 commits into
base: formsflow
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Changes for tasks count
sumesh-aot committed Nov 19, 2024
commit cf5cd281fcf35b17f21c3b712499cf65e199a5d8
Original file line number Diff line number Diff line change
@@ -68,7 +68,8 @@ def filter_tasks(body: Dict, firstResult: int = 1, maxResults: int = 100) -> fla
human_tasks_query = human_tasks_query.order_by(desc(HumanTaskModel.id)) # Order by task ID

# Paginate results for task retrieval
human_tasks = human_tasks_query.paginate(page=firstResult, per_page=maxResults, error_out=False)
page = (firstResult // maxResults) + 1
human_tasks = human_tasks_query.paginate(page=page, per_page=maxResults, error_out=False)

return _format_response(human_tasks)

Original file line number Diff line number Diff line change
@@ -253,6 +253,7 @@ def _assign_task_if_guest(task_model: TaskModel) -> bool:
status_code=400,
)
)
print(f"Assigning TASK : {human_task} to USER : {g.user_id}")
human_task_user = HumanTaskUserModel(user_id=g.user.id, human_task=human_task)
db.session.add(human_task_user)
db.session.commit()
Original file line number Diff line number Diff line change
@@ -1246,10 +1246,10 @@ def save(self) -> None:
lane_assignment_id=potential_owner_hash["lane_assignment_id"],
)
db.session.add(human_task)

for potential_owner_id in potential_owner_hash["potential_owner_ids"]:
human_task_user = HumanTaskUserModel(user_id=potential_owner_id, human_task=human_task)
db.session.add(human_task_user)
# Not needed for formsflow.ai
# for potential_owner_id in potential_owner_hash["potential_owner_ids"]:
# human_task_user = HumanTaskUserModel(user_id=potential_owner_id, human_task=human_task)
# db.session.add(human_task_user)

if len(human_tasks) > 0:
for at in human_tasks: