Open KZzizzle opened 3 years ago
can be done in "parallel" to the warning next to deleting a study #467
This has come up as well from Team Black on today's meeting (19.10). And will help also other users who might delete a study by mistake. How difficult is to implement @pcrespov?
This has come up as well from Team Black on today's meeting (19.10). And will help also other users who might delete a study by mistake. How difficult is to implement @pcrespov?
@elisabettai We already did some trials with ideas. IMO it is feasible to have a first version within a sprint.
:delete
(i.e. force-delete):recycle
:restore
[ ] projects._delete_utils.py
async def mark_project_as_deleted(
app: web.Application, project_uuid: ProjectID, user_id: UserID
):
"""
::raises ProjectInvalidRightsError
::raises ProjectNotFoundError
"""
db: ProjectDBAPI = ProjectDBAPI.get_from_app_context(app)
# TODO: tmp using invisible as a "deletion mark"
# Even if any of the steps below fail, the project will remain invisible
# TODO: see https://github.com/ITISFoundation/osparc-simcore/pull/2522
await db.check_delete_project_permission(user_id, f"{project_uuid}")
await db.check_project_has_only_one_product(project_uuid)
# NOTE: if any of the steps below fail, it might results in a
# services/projects/data that might be incosistent. The GC should
# be able to detect that and resolve it.
await db.set_hidden_flag(project_uuid, enabled=True)
Create a "folder" for deleted studies during the last 30 days so that they can be retrieved if the deletion was a mistake.