diff --git a/bricktracker/login.py b/bricktracker/login.py index 6511293..87e6683 100644 --- a/bricktracker/login.py +++ b/bricktracker/login.py @@ -53,13 +53,3 @@ class LoginManager(object): not current_app.config['LOGIN_DISABLED'] and not current_user.is_authenticated ) - - # Tell whether we are in read-only, meaning: - # - Authentication enabled - # - and User not authenticated - @staticmethod - def is_readonly() -> bool: - return ( - not current_app.config['LOGIN_DISABLED'] and - not current_user.is_authenticated - ) diff --git a/templates/macro/form.html b/templates/macro/form.html index 88c2588..2e2f8bb 100644 --- a/templates/macro/form.html +++ b/templates/macro/form.html @@ -1,13 +1,13 @@ {% macro checkbox(kind, id, text, url, checked, delete=false) %} - {% if g.login.is_readonly() %} - - {{ text }} - {% else %} + {% if g.login.is_authenticated() %} + {% else %} + + {{ text }} {% endif %} {% endmacro %} diff --git a/templates/part/table.html b/templates/part/table.html index 0881bc1..013d3c8 100644 --- a/templates/part/table.html +++ b/templates/part/table.html @@ -25,14 +25,14 @@ {{ item.fields.total_missing }} {% else %}
- {% if g.login.is_readonly() %} - - - {% else %} + {% if g.login.is_authenticated() %} - + + {% else %} + + {% endif %}
{% endif %}