mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-11 10:28:41 -04:00
Have permissions decorators check user signed in
Rather than force us to write the decorators in a specific order let’s just have one decorator call the other. This should make fewer lines of code, and fewer annoying test failures. It also means that the same way of raising a `401` (through the `current_app` method) is used everywhere.
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
from flask import redirect, render_template, session, url_for
|
||||
from flask_login import current_user, login_required
|
||||
from flask_login import current_user
|
||||
|
||||
from app.main import main
|
||||
from app.utils import PermanentRedirect
|
||||
from app.utils import PermanentRedirect, user_is_logged_in
|
||||
|
||||
|
||||
@main.route("/services")
|
||||
@@ -16,7 +16,7 @@ def services_or_dashboard():
|
||||
|
||||
|
||||
@main.route("/accounts")
|
||||
@login_required
|
||||
@user_is_logged_in
|
||||
def choose_account():
|
||||
return render_template(
|
||||
'views/choose-account.html',
|
||||
|
||||
Reference in New Issue
Block a user