_aux_functions_tasks
Auxiliary functions to get task and task-group object from the database or perform simple checks
| FUNCTION | DESCRIPTION |
|---|---|
integrity_error_to_422 |
If an IntegrityError occurs inside the context, rolls back the current |
Classes
Functions:
_check_type_filters_compatibility(*, task_input_types, wftask_type_filters)
Wrap merge_type_filters and raise HTTPException if needed.
Source code in fractal_server/app/routes/api/v2/_aux_functions_tasks.py
_get_task_full_access(*, task_id, user_id, db)
async
Get an existing task or raise a 404.
| PARAMETER | DESCRIPTION |
|---|---|
|
ID of the required task.
TYPE:
|
|
ID of the current user.
TYPE:
|
|
An asynchronous db session.
TYPE:
|
Source code in fractal_server/app/routes/api/v2/_aux_functions_tasks.py
_get_task_group_full_access(*, task_group_id, user_id, db)
async
Get a task group or raise a 403 if user has no full access.
| PARAMETER | DESCRIPTION |
|---|---|
|
ID of the required task group.
TYPE:
|
|
ID of the current user.
TYPE:
|
|
An asynchronous db session
TYPE:
|
Source code in fractal_server/app/routes/api/v2/_aux_functions_tasks.py
_get_task_group_or_404(*, task_group_id, db)
async
Get an existing task group or raise a 404.
| PARAMETER | DESCRIPTION |
|---|---|
|
The TaskGroupV2 id
TYPE:
|
|
An asynchronous db session
TYPE:
|
Source code in fractal_server/app/routes/api/v2/_aux_functions_tasks.py
_get_task_group_read_access(*, task_group_id, user_id, db)
async
Get a task group or raise a 403 if user has no read access.
| PARAMETER | DESCRIPTION |
|---|---|
|
ID of the required task group.
TYPE:
|
|
ID of the current user.
TYPE:
|
|
An asynchronous db session.
TYPE:
|
Source code in fractal_server/app/routes/api/v2/_aux_functions_tasks.py
_get_task_or_404(*, task_id, db)
async
Get an existing task or raise a 404.
| PARAMETER | DESCRIPTION |
|---|---|
|
ID of the required task.
TYPE:
|
|
An asynchronous db session
TYPE:
|
Source code in fractal_server/app/routes/api/v2/_aux_functions_tasks.py
_get_task_read_access(*, task_id, user_id, db, require_active=False)
async
Get an existing task or raise a 404.
| PARAMETER | DESCRIPTION |
|---|---|
|
ID of the required task.
TYPE:
|
|
ID of the current user.
TYPE:
|
|
An asynchronous db session.
TYPE:
|
|
If set, fail when the task group is not
TYPE:
|
Source code in fractal_server/app/routes/api/v2/_aux_functions_tasks.py
_get_valid_user_group_id(*, user_group_id=None, private, user_id, db)
async
Validate query parameters for endpoints that create some task(s).
| PARAMETER | DESCRIPTION |
|---|---|
|
TYPE:
|
|
TYPE:
|
|
ID of the current user
TYPE:
|
|
An asynchronous db session.
TYPE:
|
Source code in fractal_server/app/routes/api/v2/_aux_functions_tasks.py
integrity_error_to_422(db)
async
If an IntegrityError occurs inside the context, rolls back the current transaction and raises an HTTPException with status code 422.