mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-05 02:42:26 -05:00
Default service name if service name is not set on the session.
Pop service name off the session on sign out.
This commit is contained in:
@@ -8,5 +8,7 @@ from app.main import main
|
||||
@main.route('/sign-out', methods=(['GET']))
|
||||
@login_required
|
||||
def sign_out():
|
||||
if session.get('service_name', None):
|
||||
session.pop('service_name')
|
||||
logout_user()
|
||||
return redirect(url_for('main.index'))
|
||||
|
||||
@@ -48,17 +48,17 @@
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% if current_user.is_authenticated() %}
|
||||
{% if current_user.is_authenticated() and session['service_name'] != None %}
|
||||
<nav class="management-navigation">
|
||||
<div class="grid-row">
|
||||
<div class="column-half">
|
||||
<details class="dropdown">
|
||||
<summary class="dropdown-toggle">
|
||||
{{ session['service_name'] }}
|
||||
{{ session.get('service_name', 'Choose service') }}
|
||||
</summary>
|
||||
<div>
|
||||
<a href="{{ url_for('main.choose_service') }}">Switch service</a>
|
||||
<a href="{{ url_for('.add_service') }}">Add a new service to GOV.UK Notify</a>
|
||||
<a href="{{ url_for('main.add_service') }}">Add a new service to GOV.UK Notify</a>
|
||||
</div>
|
||||
</details>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user