- Added 'Register ...' functionality to overviews. ==> No more separate menu items...
This commit is contained in:
@@ -101,9 +101,11 @@ def catalogs():
|
||||
@document_bp.route('/handle_catalog_selection', methods=['POST'])
|
||||
@roles_accepted('Super User', 'Tenant Admin')
|
||||
def handle_catalog_selection():
|
||||
action = request.form['action']
|
||||
if action == 'create_catalog':
|
||||
return redirect(prefixed_url_for('document_bp.catalog'))
|
||||
catalog_identification = request.form.get('selected_row')
|
||||
catalog_id = ast.literal_eval(catalog_identification).get('value')
|
||||
action = request.form['action']
|
||||
catalog = Catalog.query.get_or_404(catalog_id)
|
||||
|
||||
if action == 'set_session_catalog':
|
||||
@@ -248,9 +250,11 @@ def processors():
|
||||
@document_bp.route('/handle_processor_selection', methods=['POST'])
|
||||
@roles_accepted('Super User', 'Tenant Admin')
|
||||
def handle_processor_selection():
|
||||
action = request.form['action']
|
||||
if action == 'create_processor':
|
||||
return redirect(prefixed_url_for('document_bp.processor'))
|
||||
processor_identification = request.form.get('selected_row')
|
||||
processor_id = ast.literal_eval(processor_identification).get('value')
|
||||
action = request.form['action']
|
||||
|
||||
if action == 'edit_processor':
|
||||
return redirect(prefixed_url_for('document_bp.edit_processor', processor_id=processor_id))
|
||||
@@ -359,9 +363,11 @@ def retrievers():
|
||||
@document_bp.route('/handle_retriever_selection', methods=['POST'])
|
||||
@roles_accepted('Super User', 'Tenant Admin')
|
||||
def handle_retriever_selection():
|
||||
action = request.form['action']
|
||||
if action == 'create_retriever':
|
||||
return redirect(prefixed_url_for('document_bp.retriever'))
|
||||
retriever_identification = request.form.get('selected_row')
|
||||
retriever_id = ast.literal_eval(retriever_identification).get('value')
|
||||
action = request.form['action']
|
||||
|
||||
if action == 'edit_retriever':
|
||||
return redirect(prefixed_url_for('document_bp.edit_retriever', retriever_id=retriever_id))
|
||||
|
||||
@@ -70,12 +70,14 @@ def view_license_tiers():
|
||||
@entitlements_bp.route('/handle_license_tier_selection', methods=['POST'])
|
||||
@roles_required('Super User')
|
||||
def handle_license_tier_selection():
|
||||
action = request.form['action']
|
||||
if action == 'create_license_tier':
|
||||
return redirect(prefixed_url_for('entitlements_bp.license_tier'))
|
||||
|
||||
license_tier_identification = request.form['selected_row']
|
||||
license_tier_id = ast.literal_eval(license_tier_identification).get('value')
|
||||
the_license_tier = LicenseTier.query.get(license_tier_id)
|
||||
|
||||
action = request.form['action']
|
||||
|
||||
match action:
|
||||
case 'edit_license_tier':
|
||||
return redirect(prefixed_url_for('entitlements_bp.edit_license_tier',
|
||||
|
||||
@@ -294,9 +294,12 @@ def specialists():
|
||||
@interaction_bp.route('/handle_specialist_selection', methods=['POST'])
|
||||
@roles_accepted('Super User', 'Tenant Admin')
|
||||
def handle_specialist_selection():
|
||||
action = request.form.get('action')
|
||||
if action == 'create_specialist':
|
||||
return redirect(prefixed_url_for('interaction_bp.specialist'))
|
||||
|
||||
specialist_identification = request.form.get('selected_row')
|
||||
specialist_id = ast.literal_eval(specialist_identification).get('value')
|
||||
action = request.form.get('action')
|
||||
|
||||
if action == "edit_specialist":
|
||||
return redirect(prefixed_url_for('interaction_bp.edit_specialist', specialist_id=specialist_id))
|
||||
|
||||
@@ -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':
|
||||
|
||||
Reference in New Issue
Block a user