mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-04-30 22:21:16 -04:00
I ended up creating a new test user and logged_in_client, which isn't really great. But I tried adding a current_session_id to the active user in the test, but that broke all other tests. I tried setting current_session_id in all the users being tested but that didn't work either. I'd like to come back to fixing the tests and reducing the number of conftest methods in another PR. For now this fixes the bug.
13 lines
318 B
Python
13 lines
318 B
Python
from flask import redirect, url_for
|
|
from flask_login import current_user
|
|
|
|
from app.main import main
|
|
|
|
|
|
@main.route('/sign-out', methods=(['GET']))
|
|
def sign_out():
|
|
# An AnonymousUser does not have an id
|
|
if current_user.is_authenticated:
|
|
current_user.sign_out()
|
|
return redirect(url_for('main.index'))
|