- Added 'Register ...' functionality to overviews. ==> No more separate menu items...

This commit is contained in:
Josako
2025-03-27 09:13:37 +01:00
parent 4ea16521e2
commit 6c8c33d296
22 changed files with 141 additions and 142 deletions

View File

@@ -219,6 +219,10 @@ def select_tenant():
@user_bp.route('/handle_tenant_selection', methods=['POST'])
@roles_required('Super User')
def handle_tenant_selection():
action = request.form['action']
if action == 'create_tenant':
return redirect(prefixed_url_for('user_bp.tenant'))
tenant_identification = request.form['selected_row']
tenant_id = ast.literal_eval(tenant_identification).get('value')
the_tenant = Tenant.query.get(tenant_id)
@@ -231,8 +235,6 @@ def handle_tenant_selection():
session.pop('catalog_id', None)
session.pop('catalog_name', None)
action = request.form['action']
match action:
case 'view_users':
return redirect(prefixed_url_for('user_bp.view_users', tenant_id=tenant_id))
@@ -269,10 +271,13 @@ def view_users():
@user_bp.route('/handle_user_action', methods=['POST'])
@roles_accepted('Super User', 'Tenant Admin')
def handle_user_action():
action = request.form['action']
if action == 'create_user':
return redirect(prefixed_url_for('user_bp.user'))
user_identification = request.form['selected_row']
user_id = ast.literal_eval(user_identification).get('value')
user = User.query.get_or_404(user_id)
action = request.form['action']
if action == 'edit_user':
return redirect(prefixed_url_for('user_bp.edit_user', user_id=user_id))
@@ -311,9 +316,12 @@ def view_tenant_domains():
@user_bp.route('/handle_tenant_domain_action', methods=['POST'])
@roles_accepted('Super User', 'Tenant Admin')
def handle_tenant_domain_action():
action = request.form['action']
if action == 'create_tenant_domain':
return redirect(prefixed_url_for('user_bp.tenant_domain'))
tenant_domain_identification = request.form['selected_row']
tenant_domain_id = ast.literal_eval(tenant_domain_identification).get('value')
action = request.form['action']
if action == 'edit_tenant_domain':
return redirect(prefixed_url_for('user_bp.edit_tenant_domain', tenant_domain_id=tenant_domain_id))
@@ -462,9 +470,11 @@ def tenant_projects():
@user_bp.route('/handle_tenant_project_selection', methods=['POST'])
@roles_accepted('Super User', 'Tenant Admin')
def handle_tenant_project_selection():
action = request.form.get('action')
if action == 'create_tenant_project':
return redirect(prefixed_url_for('user_bp.tenant_project'))
tenant_project_identification = request.form.get('selected_row')
tenant_project_id = ast.literal_eval(tenant_project_identification).get('value')
action = request.form.get('action')
tenant_project = TenantProject.query.get_or_404(tenant_project_id)
if action == 'edit_tenant_project':