Make new service current service on first use

When you add a new service, it’s probably the one you want to do stuff
with.

When you get invited, the service you’ve been invited to is probably the
one you want to use.

This commit adds the ID of the new service or service you’ve been
invited to to the session.
This commit is contained in:
Chris Hill-Scott
2016-04-19 10:54:26 +01:00
parent 37f341e757
commit b75ab7c3df
4 changed files with 15 additions and 11 deletions

View File

@@ -42,7 +42,7 @@ def add_service():
restricted=True,
user_id=session['user_id'],
email_from=email_from)
session['service_id'] = service_id
return redirect(url_for('main.tour', page=1))
else:
return render_template(

View File

@@ -34,6 +34,7 @@ def service_dashboard(service_id):
if session.get('invited_user'):
session.pop('invited_user', None)
session['service_id'] = service_id
return redirect(url_for("main.tour", page=1))
statistics = statistics_api_client.get_statistics_for_service(service_id)['data']