Commit 09020f2f authored by Giorgos Korfiatis's avatar Giorgos Korfiatis

astakos: Disallow base project termination

Base projects accompany users and should not be arbitrarily terminated.
parent 531f88a0
......@@ -1110,6 +1110,9 @@ def terminate(project_id, request_user=None, reason=None):
project = get_project_for_update(project_id)
project_check_allowed(project, request_user, level=ADMIN_LEVEL)
if project.is_base:
m = _(astakos_messages.BASE_NO_TERMINATE) % project.uuid
raise ProjectConflict(m)
project.terminate(actor=request_user, reason=reason)
......@@ -228,6 +228,7 @@ UNIQUE_PROJECT_NAME_CONSTRAIN_ERR = (
NOT_ALIVE_PROJECT = 'Project %s is not alive.'
NOT_SUSPENDED_PROJECT = 'Project %s is not suspended.'
NOT_TERMINATED_PROJECT = 'Project %s is not terminated.'
BASE_NO_TERMINATE = "Cannot terminate: %s is a base project."
NOT_ALLOWED = 'You do not have the permissions to perform this action.'
'You have reached the maximum number of members for this Project.')
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment