From cc758517e7a79c7b55021a73a2a03c35c0f4c384 Mon Sep 17 00:00:00 2001 From: Cory Sitko Date: Tue, 10 Oct 2017 14:13:28 -0400 Subject: [PATCH] updated login_required_if_no_ano to correct switch anonymous on/off when changed in admin --- cps/web.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cps/web.py b/cps/web.py index 1b493cfb..9935d7d4 100755 --- a/cps/web.py +++ b/cps/web.py @@ -384,9 +384,12 @@ app.jinja_env.globals['url_for_other_page'] = url_for_other_page def login_required_if_no_ano(func): - if config.config_anonbrowse == 1: - return func - return login_required(func) + @wraps(func) + def decorated_view(*args, **kwargs): + if config.config_anonbrowse == 1: + return func(*args, **kwargs) + return login_required(func)(*args, **kwargs) + return decorated_view def remote_login_required(f):