From 6ff424de24ce8698f0b5a665eedc52b3c6a57147 Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Tue, 10 Oct 2023 11:12:57 +0200 Subject: [PATCH] simple fix --- changedetectionio/__init__.py | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/changedetectionio/__init__.py b/changedetectionio/__init__.py index 550dd75eb..bfa901c02 100644 --- a/changedetectionio/__init__.py +++ b/changedetectionio/__init__.py @@ -186,22 +186,6 @@ class User(flask_login.UserMixin): pass -def login_absolutely_required(func): - @wraps(func) - def decorated_view(*args, **kwargs): - - has_password_enabled = datastore.data['settings']['application'].get('password') or os.getenv("SALTED_PASS", False) - if request.method in flask_login.config.EXEMPT_METHODS: - return func(*args, **kwargs) - elif app.config.get('LOGIN_DISABLED'): - return func(*args, **kwargs) - elif has_password_enabled and not current_user.is_authenticated: - return app.login_manager.unauthorized() - - return func(*args, **kwargs) - - return decorated_view - def login_optionally_required(func): @wraps(func) def decorated_view(*args, **kwargs): @@ -214,7 +198,6 @@ def login_optionally_required(func): # Permitted elif request.endpoint == 'diff_history_page' and datastore.data['settings']['application'].get('shared_diff_access'): return func(*args, **kwargs) - elif request.method in flask_login.config.EXEMPT_METHODS: return func(*args, **kwargs) elif app.config.get('LOGIN_DISABLED'): @@ -1445,8 +1428,8 @@ def changedetection_app(config=None, datastore_o=None): # paste in etc return redirect(url_for('index')) - @login_absolutely_required @app.route("/highlight_submit_ignore_url", methods=['POST']) + @login_optionally_required def highlight_submit_ignore_url(): import re mode = request.form.get('mode')