mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-11 18:37:33 -04:00
blunt rename of org (#620)
This commit is contained in:
@@ -3,7 +3,7 @@ from flask_login import current_user
|
||||
|
||||
from app import status_api_client
|
||||
from app.main import main
|
||||
from app.models.organisation import AllOrganisations
|
||||
from app.models.organization import AllOrganizations
|
||||
from app.utils import PermanentRedirect
|
||||
from app.utils.user import user_is_logged_in
|
||||
|
||||
@@ -24,8 +24,8 @@ def choose_account():
|
||||
org_count, live_service_count = None, None
|
||||
if current_user.platform_admin:
|
||||
org_count, live_service_count = (
|
||||
len(AllOrganisations()),
|
||||
status_api_client.get_count_of_live_services_and_organisations()['services'],
|
||||
len(AllOrganizations()),
|
||||
status_api_client.get_count_of_live_services_and_organizations()['services'],
|
||||
)
|
||||
return render_template(
|
||||
'views/choose-account.html',
|
||||
@@ -45,14 +45,14 @@ def show_accounts_or_dashboard():
|
||||
if service_id and (current_user.belongs_to_service(service_id) or current_user.platform_admin):
|
||||
return redirect(url_for('.service_dashboard', service_id=service_id))
|
||||
|
||||
organisation_id = session.get('organisation_id')
|
||||
if organisation_id and (current_user.belongs_to_organisation(organisation_id) or current_user.platform_admin):
|
||||
return redirect(url_for('.organisation_dashboard', org_id=organisation_id))
|
||||
organization_id = session.get('organization_id')
|
||||
if organization_id and (current_user.belongs_to_organization(organization_id) or current_user.platform_admin):
|
||||
return redirect(url_for('.organization_dashboard', org_id=organization_id))
|
||||
|
||||
if len(current_user.service_ids) == 1 and not current_user.organisation_ids:
|
||||
if len(current_user.service_ids) == 1 and not current_user.organization_ids:
|
||||
return redirect(url_for('.service_dashboard', service_id=current_user.service_ids[0]))
|
||||
|
||||
if len(current_user.organisation_ids) == 1 and not current_user.trial_mode_services:
|
||||
return redirect(url_for('.organisation_dashboard', org_id=current_user.organisation_ids[0]))
|
||||
if len(current_user.organization_ids) == 1 and not current_user.trial_mode_services:
|
||||
return redirect(url_for('.organization_dashboard', org_id=current_user.organization_ids[0]))
|
||||
|
||||
return redirect(url_for('.choose_account'))
|
||||
|
||||
Reference in New Issue
Block a user