_aux_functions_templates
Classes
Functions:
_check_template_duplication(*, user_id, name, version, db)
async
Ensure that no WorkflowTemplate with the same
(user_id, name, version) already exists.
| PARAMETER | DESCRIPTION |
|---|---|
|
TYPE:
|
|
TYPE:
|
|
TYPE:
|
|
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
HTTPException(status_code=HTTP_422_UNPROCESSABLE_CONTENT)
|
If a duplicate template is found. |
Source code in fractal_server/app/routes/api/v2/_aux_functions_templates.py
_get_template_full_access(*, user_id, template_id, db)
async
Retrieve a WorkflowTemplate and ensure the user is its owner.
| PARAMETER | DESCRIPTION |
|---|---|
|
TYPE:
|
|
TYPE:
|
|
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
WorkflowTemplate
|
The |
| RAISES | DESCRIPTION |
|---|---|
HTTPException(status_code=404_NOT_FOUND)
|
If no template exists with the given ID. |
HTTPException(status_code=403_FORBIDDEN)
|
If the user is not the owner. |
Source code in fractal_server/app/routes/api/v2/_aux_functions_templates.py
_get_template_or_404(*, template_id, db)
async
Retrieve a WorkflowTemplate by ID.
| PARAMETER | DESCRIPTION |
|---|---|
|
TYPE:
|
|
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
WorkflowTemplate
|
The |
| RAISES | DESCRIPTION |
|---|---|
HTTPException(status_code=404_NOT_FOUND)
|
If no template exists with the given ID. |
Source code in fractal_server/app/routes/api/v2/_aux_functions_templates.py
_get_template_read_access(*, user_id, template_id, db)
async
Retrieve a WorkflowTemplate and ensure the user has read access.
Access is granted if the user is the owner of the template or belongs to the template's user group.
| PARAMETER | DESCRIPTION |
|---|---|
|
TYPE:
|
|
TYPE:
|
|
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
WorkflowTemplate
|
The |
| RAISES | DESCRIPTION |
|---|---|
HTTPException(status_code=404_NOT_FOUND)
|
If no template exists with the given ID. |
HTTPException(status_code=403_FORBIDDEN)
|
If the user has not read access. |