From 4164ad29e3a9a08951a9fa27bd3a5d9403fdc052 Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Fri, 30 Apr 2021 19:54:23 +1000 Subject: [PATCH] Re #44 - Broke the menu by accident, adding tests and fixing. --- backend/__init__.py | 1 + backend/store.py | 2 +- backend/templates/base.html | 10 +++++----- backend/tests/test_backend.py | 19 +++++++++++++++++++ changedetection.py | 9 ++++----- 5 files changed, 30 insertions(+), 11 deletions(-) diff --git a/backend/__init__.py b/backend/__init__.py index 868c0dbb..da5975db 100644 --- a/backend/__init__.py +++ b/backend/__init__.py @@ -92,6 +92,7 @@ class User(flask_login.UserMixin): def get_user(self, email="defaultuser@changedetection.io"): return self def is_authenticated(self): + return True def is_active(self): return True diff --git a/backend/store.py b/backend/store.py index 3fcee92d..4078d8a7 100644 --- a/backend/store.py +++ b/backend/store.py @@ -110,7 +110,7 @@ class ChangeDetectionStore: self.add_watch(url='https://changedetection.io', tag='Tech news') - self.__data['version_tag'] = "0.29" + self.__data['version_tag'] = "0.291" if not 'app_guid' in self.__data: self.__data['app_guid'] = str(uuid_builder.uuid4()) diff --git a/backend/templates/base.html b/backend/templates/base.html index 1a6edbf6..561e1b93 100644 --- a/backend/templates/base.html +++ b/backend/templates/base.html @@ -17,7 +17,7 @@
- {% if not current_user.is_authenticated %} + {% if has_password and not current_user.is_authenticated %} ChangeDetection.io {% else %} ChangeDetection.io @@ -31,7 +31,7 @@ {% endif %}
    - {% if current_user.is_authenticated %} + {% if current_user.is_authenticated or not has_password %}
  • BACKUP
  • @@ -47,9 +47,9 @@ {% endif %} - {% if current_user.is_authenticated %} -
  • LOG OUT
  • - {% endif %} + {% if current_user.is_authenticated %} +
  • LOG OUT
  • + {% endif %}