Rename all_services property on user

For consistency with `.organisations`/`.organisation_ids`.

`.services` returns a list of semi-rich dictionaries for each service.

`.service_ids` returns service IDs only.
This commit is contained in:
Chris Hill-Scott
2019-06-07 12:22:15 +01:00
parent 2f711b52ea
commit 062f42b769
4 changed files with 15 additions and 18 deletions

View File

@@ -31,17 +31,17 @@ def show_accounts_or_dashboard():
return redirect(url_for('.index'))
service_id = session.get('service_id')
if service_id and (service_id in current_user.services or current_user.platform_admin):
if service_id and (service_id in current_user.service_ids 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 (organisation_id in current_user.organisation_ids or current_user.platform_admin):
return redirect(url_for('.organisation_dashboard', org_id=organisation_id))
if len(current_user.services) == 1 and not current_user.organisation_ids:
return redirect(url_for('.service_dashboard', service_id=current_user.services[0]))
if len(current_user.service_ids) == 1 and not current_user.organisation_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.services:
if len(current_user.organisation_ids) == 1 and not current_user.service_ids:
return redirect(url_for('.organisation_dashboard', org_id=current_user.organisation_ids[0]))
return redirect(url_for('.choose_account'))