mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-07 12:28:25 -04: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']))
|
@main.route('/sign-out', methods=(['GET']))
|
||||||
@login_required
|
@login_required
|
||||||
def sign_out():
|
def sign_out():
|
||||||
|
if session.get('service_name', None):
|
||||||
|
session.pop('service_name')
|
||||||
logout_user()
|
logout_user()
|
||||||
return redirect(url_for('main.index'))
|
return redirect(url_for('main.index'))
|
||||||
|
|||||||
@@ -48,17 +48,17 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
{% if current_user.is_authenticated() %}
|
{% if current_user.is_authenticated() and session['service_name'] != None %}
|
||||||
<nav class="management-navigation">
|
<nav class="management-navigation">
|
||||||
<div class="grid-row">
|
<div class="grid-row">
|
||||||
<div class="column-half">
|
<div class="column-half">
|
||||||
<details class="dropdown">
|
<details class="dropdown">
|
||||||
<summary class="dropdown-toggle">
|
<summary class="dropdown-toggle">
|
||||||
{{ session['service_name'] }}
|
{{ session.get('service_name', 'Choose service') }}
|
||||||
</summary>
|
</summary>
|
||||||
<div>
|
<div>
|
||||||
<a href="{{ url_for('main.choose_service') }}">Switch service</a>
|
<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>
|
</div>
|
||||||
</details>
|
</details>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user