Self hosted FLOSS fitness/workout, nutrition and weight tracker
Re-add local import
Roland Geider3a62e1604bf2
diff --git a/wger/exercises/api/serializers.py b/wger/exercises/api/serializers.pyindex fcc0ad5a1..d45fcdf24 100644--- a/wger/exercises/api/serializers.py+++ b/wger/exercises/api/serializers.py@@ -16,6 +16,7 @@from django.conf import settingsfrom django.core.cache import cachefrom django.db.models import Q+# Third Partyfrom rest_framework import serializersdiff --git a/wger/exercises/api/views.py b/wger/exercises/api/views.pyindex bb7f2e260..ed10a40b5 100644--- a/wger/exercises/api/views.py+++ b/wger/exercises/api/views.py@@ -17,10 +17,6 @@import loggingfrom uuid import UUID-# Third Party-import bleach-from actstream import action as actstream_action-from bleach.css_sanitizer import CSSSanitizer# Djangofrom django.conf import settingsfrom django.contrib.postgres.search import TrigramSimilarity@@ -28,6 +24,11 @@ from django.db.models import Qfrom django.utils.decorators import method_decoratorfrom django.utils.translation import gettext as _from django.views.decorators.cache import cache_page++# Third Party+import bleach+from actstream import action as actstream_action+from bleach.css_sanitizer import CSSSanitizerfrom drf_spectacular.types import OpenApiTypesfrom drf_spectacular.utils import (OpenApiParameter,@@ -91,6 +92,7 @@ from wger.utils.constants import (from wger.utils.db import is_postgres_dbfrom wger.utils.language import load_language+logger = logging.getLogger(__name__)diff --git a/wger/exercises/apps.py b/wger/exercises/apps.pyindex 534797d21..a4ec74f71 100644--- a/wger/exercises/apps.py+++ b/wger/exercises/apps.py@@ -23,6 +23,7 @@ class ExerciseConfig(AppConfig):verbose_name = 'Exercise'def ready(self):+ import wger.exercises.signalsfrom actstream import registryregistry.register(self.get_model('Alias'))diff --git a/wger/exercises/management/commands/read-exercise-cleanup.py b/wger/exercises/management/commands/read-exercise-cleanup.pyindex 85ca8d3c0..697ad5f87 100644--- a/wger/exercises/management/commands/read-exercise-cleanup.py+++ b/wger/exercises/management/commands/read-exercise-cleanup.py@@ -37,6 +37,7 @@ from wger.exercises.models import ()from wger.utils.constants import CC_BY_SA_4_ID+UUID_NEW = 'NEW'VIDEO_AUTHOR = 'Goulart'VIDEO_PATH = pathlib.Path('videos-tmp')diff --git a/wger/exercises/models/base.py b/wger/exercises/models/base.pyindex 64fdee960..8e853656c 100644--- a/wger/exercises/models/base.py+++ b/wger/exercises/models/base.py@@ -34,6 +34,7 @@ from django.utils.translation import (get_language,gettext_lazy as _,)+# Third Partyfrom simple_history.models import HistoricalRecords@@ -51,6 +52,7 @@ from wger.utils.models import (AbstractLicenseModel,collect_models_author_history,)+# Localfrom .category import ExerciseCategoryfrom .equipment import Equipmentdiff --git a/wger/exercises/models/comment.py b/wger/exercises/models/comment.pyindex cf619559e..2644bb897 100644--- a/wger/exercises/models/comment.py+++ b/wger/exercises/models/comment.py@@ -20,11 +20,13 @@ import uuid# Djangofrom django.db import modelsfrom django.utils.translation import gettext_lazy as _+# Third Partyfrom simple_history.models import HistoricalRecords# wgerfrom wger.utils.cache import reset_exercise_api_cache+# Localfrom .translation import Translationdiff --git a/wger/exercises/models/deletion_log.py b/wger/exercises/models/deletion_log.pyindex d7e9aa048..3b8775f59 100644--- a/wger/exercises/models/deletion_log.py+++ b/wger/exercises/models/deletion_log.py@@ -61,7 +61,7 @@ class DeletionLog(models.Model):null=True,verbose_name='Replaced by',help_text='UUID of the object replaced by the deleted one. At the moment only available '- 'for exercise bases',+ 'for exercises',)timestamp = models.DateTimeField(auto_now=True)diff --git a/wger/exercises/models/exercise_alias.py b/wger/exercises/models/exercise_alias.pyindex bc9d505bc..f4f03af60 100644--- a/wger/exercises/models/exercise_alias.py+++ b/wger/exercises/models/exercise_alias.py@@ -21,11 +21,13 @@ import uuidfrom django.contrib.postgres.indexes import GinIndexfrom django.db import modelsfrom django.utils.translation import gettext_lazy as _+# Third Partyfrom simple_history.models import HistoricalRecords# wgerfrom wger.utils.cache import reset_exercise_api_cache+# Localfrom .translation import Translationdiff --git a/wger/exercises/models/image.py b/wger/exercises/models/image.pyindex be02bea1f..797bd57b4 100644--- a/wger/exercises/models/image.py+++ b/wger/exercises/models/image.py@@ -21,6 +21,7 @@ import uuid# Djangofrom django.db import modelsfrom django.utils.translation import gettext_lazy as _+# Third Partyfrom simple_history.models import HistoricalRecordsdiff --git a/wger/exercises/models/translation.py b/wger/exercises/models/translation.pyindex 7ed28b2b6..495783f48 100644--- a/wger/exercises/models/translation.py+++ b/wger/exercises/models/translation.py@@ -17,8 +17,6 @@# Standard Libraryimport uuid-# Third Party-import bleach# Djangofrom django.contrib.postgres.indexes import GinIndexfrom django.core.validators import MinLengthValidator@@ -26,6 +24,9 @@ from django.db import modelsfrom django.urls import reversefrom django.utils.text import slugifyfrom django.utils.translation import gettext_lazy as _++# Third Party+import bleachfrom simple_history.models import HistoricalRecords# wgerdiff --git a/wger/exercises/models/video.py b/wger/exercises/models/video.pyindex f0f52be12..07ba6e8b2 100644--- a/wger/exercises/models/video.py+++ b/wger/exercises/models/video.py@@ -22,12 +22,14 @@ import uuidfrom django.core.exceptions import ValidationErrorfrom django.db import modelsfrom django.utils.translation import gettext_lazy as _+# Third Partyfrom simple_history.models import HistoricalRecords# wgerfrom wger.utils.cache import reset_exercise_api_cache+try:# Third Partyimport ffmpegdiff --git a/wger/exercises/signals.py b/wger/exercises/signals.pyindex 0278803ba..47c5aa522 100644--- a/wger/exercises/signals.py+++ b/wger/exercises/signals.py@@ -24,6 +24,7 @@ from django.db.models.signals import (pre_save,)from django.dispatch import receiver+# Third Partyfrom easy_thumbnails.files import get_thumbnailerfrom easy_thumbnails.signal_handlers import generate_aliasesdiff --git a/wger/exercises/sync.py b/wger/exercises/sync.pyindex e2b301283..22a238cc6 100644--- a/wger/exercises/sync.py+++ b/wger/exercises/sync.py@@ -15,13 +15,14 @@# Standard Libraryimport os-# Third Party-import requests# Djangofrom django.conf import settingsfrom django.core.files import Filefrom django.core.files.temp import NamedTemporaryFile+# Third Party+import requests+# wgerfrom wger.core.api.endpoints import (LANGUAGE_ENDPOINT,diff --git a/wger/exercises/tests/test_exercise_translation.py b/wger/exercises/tests/test_exercise_translation.pyindex 2b4679ff0..cab842417 100644--- a/wger/exercises/tests/test_exercise_translation.py+++ b/wger/exercises/tests/test_exercise_translation.py@@ -21,6 +21,7 @@ from django.template import (Template,)from django.urls import reverse+# Third Partyfrom rest_framework import statusdiff --git a/wger/exercises/tests/test_history.py b/wger/exercises/tests/test_history.pyindex 4e826bcfd..df3869ca3 100644--- a/wger/exercises/tests/test_history.py+++ b/wger/exercises/tests/test_history.py@@ -12,13 +12,14 @@## You should have received a copy of the GNU Affero General Public License-# Third Party-from actstream import action as actstream_action# Djangofrom django.contrib.auth.models import Userfrom django.contrib.contenttypes.models import ContentTypefrom django.urls import reverse+# Third Party+from actstream import action as actstream_action+# wgerfrom wger.core.tests.base_testcase import WgerTestCasefrom wger.exercises.models import Translationdiff --git a/wger/exercises/views/exercises.py b/wger/exercises/views/exercises.pyindex 0738b59a1..6e2ca0858 100644--- a/wger/exercises/views/exercises.py+++ b/wger/exercises/views/exercises.py@@ -37,6 +37,7 @@ from django.views.generic import DeleteViewfrom wger.exercises.models import Translationfrom wger.utils.generic_views import WgerDeleteMixin+logger = logging.getLogger(__name__)diff --git a/wger/manager/api/views.py b/wger/manager/api/views.pyindex c3e55ac77..850f4ac88 100644--- a/wger/manager/api/views.py+++ b/wger/manager/api/views.py@@ -21,6 +21,7 @@ from datetime import datetime# Djangofrom django.shortcuts import get_object_or_404+# Third Partyfrom rest_framework import viewsetsfrom rest_framework.decorators import actiondiff --git a/wger/manager/forms.py b/wger/manager/forms.pyindex ebabb16cd..e72133764 100644--- a/wger/manager/forms.py+++ b/wger/manager/forms.py@@ -17,14 +17,6 @@This file contains forms used in the application"""-# Third Party-from crispy_forms.helper import FormHelper-from crispy_forms.layout import (- Column,- Layout,- Row,- Submit,-)# Djangofrom django.forms import (BooleanField,@@ -43,6 +35,15 @@ from django.utils.translation import (gettext_lazy,)+# Third Party+from crispy_forms.helper import FormHelper+from crispy_forms.layout import (+ Column,+ Layout,+ Row,+ Submit,+)+# wgerfrom wger.core.models import (RepetitionUnit,diff --git a/wger/manager/management/commands/dummy-generator-routines.py b/wger/manager/management/commands/dummy-generator-routines.pyindex d6dd6c232..7bc98a3f8 100644--- a/wger/manager/management/commands/dummy-generator-routines.py+++ b/wger/manager/management/commands/dummy-generator-routines.py@@ -34,6 +34,7 @@ from wger.manager.models import (WeightConfig,)+logger = logging.getLogger(__name__)diff --git a/wger/manager/tests/test_weight_log.py b/wger/manager/tests/test_weight_log.pyindex d89b97610..fe84078b1 100644--- a/wger/manager/tests/test_weight_log.py+++ b/wger/manager/tests/test_weight_log.py@@ -32,6 +32,7 @@ from wger.core.tests.base_testcase import (from wger.manager.models import WorkoutLogfrom wger.utils.cache import cache_mapper+logger = logging.getLogger(__name__)diff --git a/wger/software/views.py b/wger/software/views.pyindex eda53cd7a..88e198d19 100644--- a/wger/software/views.py+++ b/wger/software/views.py@@ -15,14 +15,15 @@# Standard Libraryimport logging-# Third Party-import requests# Djangofrom django.conf import settingsfrom django.contrib.auth.models import Userfrom django.core.cache import cachefrom django.shortcuts import render+# Third Party+import requests+# wgerfrom wger.core.forms import (RegistrationForm,@@ -31,6 +32,7 @@ from wger.core.forms import (from wger.exercises.models import Exercisefrom wger.nutrition.models import Ingredient+logger = logging.getLogger(__name__)CACHE_KEY = 'landing-page-context'diff --git a/wger/urls.py b/wger/urls.pyindex 4ff616563..69e554979 100644--- a/wger/urls.py+++ b/wger/urls.py@@ -25,6 +25,7 @@ from django.contrib.sitemaps.views import (sitemap,)from django.urls import path+# Third Partyfrom django_email_verification import urls as email_urlsfrom drf_spectacular.views import (@@ -50,6 +51,7 @@ from wger.nutrition.api import views as nutrition_api_viewsfrom wger.utils.generic_views import TextTemplateViewfrom wger.weight.api import views as weight_api_views+## REST API#