Self hosted FLOSS fitness/workout, nutrition and weight tracker
Sort imports using isort
Rolanddcd31635699b
diff --git a/manage.py b/manage.pyindex d55df6793..f79cb6c7e 100644--- a/manage.py+++ b/manage.py@@ -3,7 +3,7 @@# Standard Libraryimport sys-# Third Party+# Djangofrom django.core.management import execute_from_command_line# wgerdiff --git a/setup.cfg b/setup.cfgindex 7b55f4abf..07f84f4b5 100644--- a/setup.cfg+++ b/setup.cfg@@ -40,14 +40,16 @@ line_length=119# A comment to consistently place directly above future imports.import_heading_future=Future+# A comment to consistently place directly above django imports.+import_heading_django=Django+# A comment to consistently place directly above imports from the standard library.import_heading_stdlib=Standard Library# A comment to consistently place directly above thirdparty imports.import_heading_thirdparty=Third Party-# A comment to consistently place directly above imports from the current-# project.+# A comment to consistently place directly above wger imports.import_heading_firstparty=wger# A comment to consistently place directly above imports that start with '.'.@@ -60,6 +62,7 @@ indent=' '# A list of imports that will be forced to display withing the first party# category.known_first_party=wger+known_django=django# An integer that represents how you want imports to be displayed if their long# enough to span multiple lines. A full definition of all possible modes can bediff --git a/wger/config/__init__.py b/wger/config/__init__.pyindex 1cdac5f30..b0db020b9 100644--- a/wger/config/__init__.py+++ b/wger/config/__init__.py@@ -16,7 +16,9 @@# along with Workout Manager. If not, see <http://www.gnu.org/licenses/>.+# wgerfrom wger import get_version+VERSION = get_version()default_app_config = 'wger.config.apps.ConfigConfig'diff --git a/wger/config/apps.py b/wger/config/apps.pyindex dc093f300..45467eee7 100644--- a/wger/config/apps.py+++ b/wger/config/apps.py@@ -14,7 +14,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.apps import AppConfigdiff --git a/wger/config/models.py b/wger/config/models.pyindex a05f8c88e..705ee5615 100644--- a/wger/config/models.py+++ b/wger/config/models.py@@ -18,7 +18,7 @@# Standard Libraryimport logging-# Third Party+# Djangofrom django.core.cache import cachefrom django.db import modelsfrom django.utils.translation import ugettext_lazy as _diff --git a/wger/config/signals.py b/wger/config/signals.pyindex dcbbaac15..7d882b105 100644--- a/wger/config/signals.py+++ b/wger/config/signals.py@@ -15,7 +15,7 @@# You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.db.models.signals import post_savefrom django.dispatch import receiverdiff --git a/wger/config/tests/test_custom_header.py b/wger/config/tests/test_custom_header.pyindex 2c18301f5..35d963e74 100644--- a/wger/config/tests/test_custom_header.py+++ b/wger/config/tests/test_custom_header.py@@ -15,7 +15,7 @@# You should have received a copy of the GNU Affero General Public License# along with Workout Manager. If not, see <http://www.gnu.org/licenses/>.-# Third Party+# Djangofrom django.urls import reverse# wgerdiff --git a/wger/config/tests/test_gym_config.py b/wger/config/tests/test_gym_config.pyindex 9bc74dca5..8317ea0d6 100644--- a/wger/config/tests/test_gym_config.py+++ b/wger/config/tests/test_gym_config.py@@ -15,7 +15,7 @@# You should have received a copy of the GNU Affero General Public License# along with Workout Manager. If not, see <http://www.gnu.org/licenses/>.-# Third Party+# Djangofrom django.contrib.auth.models import Userfrom django.urls import reversediff --git a/wger/config/urls.py b/wger/config/urls.pyindex 519816f6c..25ea19b62 100644--- a/wger/config/urls.py+++ b/wger/config/urls.py@@ -15,7 +15,7 @@# You should have received a copy of the GNU Affero General Public License# along with Workout Manager. If not, see <http://www.gnu.org/licenses/>.-# Third Party+# Djangofrom django.conf.urls import (include,urldiff --git a/wger/config/views/gym_config.py b/wger/config/views/gym_config.pyindex 5aaab334b..8c284d09b 100644--- a/wger/config/views/gym_config.py+++ b/wger/config/views/gym_config.py@@ -17,7 +17,7 @@# Standard Libraryimport logging-# Third Party+# Djangofrom django.urls import (reverse,reverse_lazydiff --git a/wger/config/views/language_config.py b/wger/config/views/language_config.pyindex 6d7ca0a85..f1082171e 100644--- a/wger/config/views/language_config.py+++ b/wger/config/views/language_config.py@@ -17,7 +17,7 @@# Standard Libraryimport logging-# Third Party+# Djangofrom django.contrib.auth.mixins import (LoginRequiredMixin,PermissionRequiredMixindiff --git a/wger/core/__init__.py b/wger/core/__init__.pyindex 703386020..ff2015c66 100644--- a/wger/core/__init__.py+++ b/wger/core/__init__.py@@ -16,7 +16,9 @@# along with Workout Manager. If not, see <http://www.gnu.org/licenses/>.+# wgerfrom wger import get_version+VERSION = get_version()default_app_config = 'wger.core.apps.CoreConfig'diff --git a/wger/core/api/views.py b/wger/core/api/views.pyindex 5bf68bb70..6e33346e0 100644--- a/wger/core/api/views.py+++ b/wger/core/api/views.py@@ -15,8 +15,10 @@# You should have received a copy of the GNU Affero General Public License# along with Workout Manager. If not, see <http://www.gnu.org/licenses/>.-# Third Party+# Djangofrom django.contrib.auth.models import User++# Third Partyfrom rest_framework import viewsetsfrom rest_framework.decorators import actionfrom rest_framework.response import Responsediff --git a/wger/core/apps.py b/wger/core/apps.pyindex 6ae7a28ec..17fae27ef 100644--- a/wger/core/apps.py+++ b/wger/core/apps.py@@ -14,7 +14,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.apps import AppConfigdiff --git a/wger/core/demo.py b/wger/core/demo.pyindex be41076dd..1aa29cee3 100644--- a/wger/core/demo.py+++ b/wger/core/demo.py@@ -20,7 +20,7 @@ import loggingimport randomimport uuid-# Third Party+# Djangofrom django.contrib.auth import authenticatefrom django.contrib.auth.models import Userfrom django.utils.translation import ugettext as _diff --git a/wger/core/forms.py b/wger/core/forms.pyindex 7ac69084b..73c2ef4d7 100644--- a/wger/core/forms.py+++ b/wger/core/forms.py@@ -14,8 +14,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party-from captcha.fields import ReCaptchaField+# Djangofrom django import formsfrom django.contrib.auth.forms import (AuthenticationForm,@@ -32,6 +31,9 @@ from django.forms import ()from django.utils.translation import ugettext as _+# Third Party+from captcha.fields import ReCaptchaField+# wgerfrom wger.core.models import UserProfilediff --git a/wger/core/management/commands/clear-cache.py b/wger/core/management/commands/clear-cache.pyindex 90e9f2a14..c88316bf3 100644--- a/wger/core/management/commands/clear-cache.py+++ b/wger/core/management/commands/clear-cache.py@@ -14,7 +14,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.contrib.auth.models import Userfrom django.core.cache import cachefrom django.core.management.base import (diff --git a/wger/core/management/commands/delete-temp-users.py b/wger/core/management/commands/delete-temp-users.pyindex 7750ca2d5..a957bf522 100644--- a/wger/core/management/commands/delete-temp-users.py+++ b/wger/core/management/commands/delete-temp-users.py@@ -17,7 +17,7 @@# Standard Libraryimport datetime-# Third Party+# Djangofrom django.core.management.base import BaseCommandfrom django.utils.timezone import nowdiff --git a/wger/core/management/commands/extract-i18n.py b/wger/core/management/commands/extract-i18n.pyindex ca366b948..c1adc5cf6 100644--- a/wger/core/management/commands/extract-i18n.py+++ b/wger/core/management/commands/extract-i18n.py@@ -14,7 +14,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.core.management.base import BaseCommand# wgerdiff --git a/wger/core/management/commands/update-user-cache.py b/wger/core/management/commands/update-user-cache.pyindex 4b09f09e3..7d680f329 100644--- a/wger/core/management/commands/update-user-cache.py+++ b/wger/core/management/commands/update-user-cache.py@@ -14,7 +14,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.contrib.auth.models import Userfrom django.core.management.base import BaseCommanddiff --git a/wger/core/models.py b/wger/core/models.pyindex cc1e2fa6c..0298003dc 100644--- a/wger/core/models.py+++ b/wger/core/models.py@@ -18,16 +18,16 @@import datetimeimport decimal-# Third Party+# Djangofrom django.contrib.auth.models import Userfrom django.core.exceptions import ValidationError-from django.urls import reversefrom django.core.validators import (MaxValueValidator,MinValueValidator)from django.db import modelsfrom django.db.models import IntegerField+from django.urls import reversefrom django.utils.translation import ugettext_lazy as _# wgerdiff --git a/wger/core/signals.py b/wger/core/signals.pyindex 8b933b49a..6031bf35b 100644--- a/wger/core/signals.py+++ b/wger/core/signals.py@@ -15,13 +15,17 @@# You should have received a copy of the GNU Affero General Public License-# Third Party+# Standard Library+import datetime++# Djangofrom django.contrib.auth.models import User-from django.db.models.signals import post_save, pre_save+from django.db.models.signals import (+ post_save,+ pre_save+)from django.dispatch import receiver-import datetime-# wgerfrom wger.core.models import (UserCache,diff --git a/wger/core/templatetags/wger_extras.py b/wger/core/templatetags/wger_extras.pyindex c06247f75..0d26daba6 100644--- a/wger/core/templatetags/wger_extras.py+++ b/wger/core/templatetags/wger_extras.py@@ -14,7 +14,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django import templatefrom django.conf import settingsfrom django.forms.widgets import (diff --git a/wger/core/tests/api_base_test.py b/wger/core/tests/api_base_test.pyindex fe9e2bb6f..47d75eb15 100644--- a/wger/core/tests/api_base_test.py+++ b/wger/core/tests/api_base_test.py@@ -13,8 +13,10 @@# You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.contrib.auth.models import User++# Third Partyfrom rest_framework import statusfrom rest_framework.test import APITestCasediff --git a/wger/core/tests/base_testcase.py b/wger/core/tests/base_testcase.pyindex cbcb71709..e94b48bd8 100644--- a/wger/core/tests/base_testcase.py+++ b/wger/core/tests/base_testcase.py@@ -19,14 +19,14 @@ import osimport shutilimport tempfile-# Third Party+# Djangofrom django.conf import settingsfrom django.core.cache import cache+from django.test import TestCasefrom django.urls import (NoReverseMatch,reverse)-from django.test import TestCase# wgerfrom wger.utils.constants import TWOPLACESdiff --git a/wger/core/tests/test_apikey.py b/wger/core/tests/test_apikey.pyindex 9ce8e6564..cd2222585 100644--- a/wger/core/tests/test_apikey.py+++ b/wger/core/tests/test_apikey.py@@ -15,9 +15,11 @@# Standard Libraryimport logging-# Third Party+# Djangofrom django.contrib.auth.models import Userfrom django.urls import reverse++# Third Partyfrom rest_framework.authtoken.models import Token# wgerdiff --git a/wger/core/tests/test_change_password.py b/wger/core/tests/test_change_password.pyindex bc388ad6e..c06f8ce8d 100644--- a/wger/core/tests/test_change_password.py+++ b/wger/core/tests/test_change_password.py@@ -15,7 +15,7 @@# Standard Libraryimport logging-# Third Party+# Djangofrom django.contrib.auth.models import Userfrom django.urls import reversediff --git a/wger/core/tests/test_delete_user.py b/wger/core/tests/test_delete_user.pyindex 899ff9676..735a2e632 100644--- a/wger/core/tests/test_delete_user.py+++ b/wger/core/tests/test_delete_user.py@@ -15,7 +15,7 @@# Standard Libraryimport logging-# Third Party+# Djangofrom django.contrib.auth.models import Userfrom django.urls import reversediff --git a/wger/core/tests/test_feedback.py b/wger/core/tests/test_feedback.pyindex a87466b2d..786df60e0 100644--- a/wger/core/tests/test_feedback.py+++ b/wger/core/tests/test_feedback.py@@ -12,13 +12,15 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Standard Library+from unittest import skip++# Djangofrom django.core import mailfrom django.urls import reverse# wgerfrom wger.core.tests.base_testcase import WorkoutManagerTestCase-from unittest import skipclass FeedbackTestCase(WorkoutManagerTestCase):diff --git a/wger/core/tests/test_index.py b/wger/core/tests/test_index.pyindex af5b17e9f..5e058a994 100644--- a/wger/core/tests/test_index.py+++ b/wger/core/tests/test_index.py@@ -13,7 +13,7 @@# You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.urls import reverse# wgerdiff --git a/wger/core/tests/test_language.py b/wger/core/tests/test_language.pyindex 11dab8c89..253f6c556 100644--- a/wger/core/tests/test_language.py+++ b/wger/core/tests/test_language.py@@ -15,7 +15,7 @@# You should have received a copy of the GNU Affero General Public License# along with Workout Manager. If not, see <http://www.gnu.org/licenses/>.-# Third Party+# Djangofrom django.urls import reverse_lazy# wgerdiff --git a/wger/core/tests/test_preferences.py b/wger/core/tests/test_preferences.pyindex 64b8547b5..e02a3c693 100644--- a/wger/core/tests/test_preferences.py+++ b/wger/core/tests/test_preferences.py@@ -17,7 +17,7 @@ import datetimeimport decimalimport logging-# Third Party+# Djangofrom django.contrib.auth.models import Userfrom django.urls import reversediff --git a/wger/core/tests/test_registration.py b/wger/core/tests/test_registration.pyindex 46119bbf7..c048cc5ea 100644--- a/wger/core/tests/test_registration.py+++ b/wger/core/tests/test_registration.py@@ -15,7 +15,7 @@# Standard Libraryimport logging-# Third Party+# Djangofrom django.contrib.auth.models import Userfrom django.urls import reversediff --git a/wger/core/tests/test_robots_txt.py b/wger/core/tests/test_robots_txt.pyindex 1b7159748..c6073113d 100644--- a/wger/core/tests/test_robots_txt.py+++ b/wger/core/tests/test_robots_txt.py@@ -12,7 +12,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.urls import reverse# wgerdiff --git a/wger/core/tests/test_sitemap.py b/wger/core/tests/test_sitemap.pyindex 529c0cbdd..a1c5f5fc7 100644--- a/wger/core/tests/test_sitemap.py+++ b/wger/core/tests/test_sitemap.py@@ -12,7 +12,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.urls import reverse# wgerdiff --git a/wger/core/tests/test_spaceless.py b/wger/core/tests/test_spaceless.pyindex 1b1985f2f..20aa21ec4 100644--- a/wger/core/tests/test_spaceless.py+++ b/wger/core/tests/test_spaceless.py@@ -15,7 +15,7 @@# Standard Libraryimport logging-# Third Party+# Djangofrom django.template import (Context,Templatediff --git a/wger/core/tests/test_temporary_users.py b/wger/core/tests/test_temporary_users.pyindex f43ccfc93..04d9579df 100644--- a/wger/core/tests/test_temporary_users.py+++ b/wger/core/tests/test_temporary_users.py@@ -16,7 +16,7 @@import datetimeimport random-# Third Party+# Djangofrom django.contrib.auth.models import Userfrom django.core.management import call_commandfrom django.urls import reversediff --git a/wger/core/tests/test_user.py b/wger/core/tests/test_user.pyindex 6d792c704..ac8f0a56a 100644--- a/wger/core/tests/test_user.py+++ b/wger/core/tests/test_user.py@@ -12,7 +12,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.contrib.auth.models import Userfrom django.urls import (reverse,diff --git a/wger/core/urls.py b/wger/core/urls.pyindex d47b1b5a2..580eb7aa2 100644--- a/wger/core/urls.py+++ b/wger/core/urls.py@@ -15,7 +15,7 @@# You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.conf.urls import (include,url@@ -25,6 +25,7 @@ from django.urls import reverse_lazyfrom django.views.generic import TemplateView# wger+from wger.core.forms import UserLoginFormfrom wger.core.views import (languages,license,@@ -34,7 +35,6 @@ from wger.core.views import (weight_units)-from wger.core.forms import UserLoginForm# sub patterns for languagespatterns_language = [diff --git a/wger/core/views/languages.py b/wger/core/views/languages.pyindex 7155de212..813d7fdbd 100644--- a/wger/core/views/languages.py+++ b/wger/core/views/languages.py@@ -17,7 +17,7 @@# Standard Libraryimport logging-# Third Party+# Djangofrom django.contrib.auth.mixins import (LoginRequiredMixin,PermissionRequiredMixin@@ -41,9 +41,9 @@ from django.views.generic import (# wgerfrom wger.core.models import Languagefrom wger.utils.generic_views import (+ UAAwareViewMixin,WgerDeleteMixin,- WgerFormMixin,- UAAwareViewMixin+ WgerFormMixin)diff --git a/wger/core/views/license.py b/wger/core/views/license.pyindex ea2249fba..045f910e0 100644--- a/wger/core/views/license.py+++ b/wger/core/views/license.py@@ -17,7 +17,7 @@# Standard Libraryimport logging-# Third Party+# Djangofrom django.contrib.auth.mixins import (LoginRequiredMixin,PermissionRequiredMixin@@ -40,9 +40,9 @@ from django.views.generic import (# wgerfrom wger.core.models import Licensefrom wger.utils.generic_views import (+ UAAwareViewMixin,WgerDeleteMixin,- WgerFormMixin,- UAAwareViewMixin+ WgerFormMixin)diff --git a/wger/core/views/misc.py b/wger/core/views/misc.pyindex 8f42c324e..31b4d0905 100644--- a/wger/core/views/misc.py+++ b/wger/core/views/misc.py@@ -17,23 +17,23 @@# Standard Libraryimport logging-# Third Party+# Djangofrom django.conf import settingsfrom django.contrib import messagesfrom django.contrib.auth import login as django_loginfrom django.contrib.auth.decorators import login_requiredfrom django.core import mailfrom django.core.exceptions import ObjectDoesNotExist+from django.http import HttpResponseRedirect+from django.template.loader import render_to_stringfrom django.urls import (reverse,reverse_lazy)-from django.http import HttpResponseRedirect-from django.template.loader import render_to_stringfrom django.utils.translation import ugettext as _+from django.views.decorators.vary import vary_on_headersfrom django.views.generic import TemplateViewfrom django.views.generic.edit import FormView-from django.views.decorators.vary import vary_on_headers# wgerfrom wger.core.demo import (@@ -47,9 +47,9 @@ from wger.core.forms import (from wger.core.models import DaysOfWeekfrom wger.manager.models import Schedulefrom wger.nutrition.models import NutritionPlan+from wger.utils.helpers import ua_aware_renderfrom wger.weight.helpers import get_last_entriesfrom wger.weight.models import WeightEntry-from wger.utils.helpers import ua_aware_renderlogger = logging.getLogger(__name__)diff --git a/wger/core/views/repetition_units.py b/wger/core/views/repetition_units.pyindex ddb421dfe..58c0903c7 100644--- a/wger/core/views/repetition_units.py+++ b/wger/core/views/repetition_units.py@@ -17,13 +17,13 @@# Standard Libraryimport logging-# Third Party+# Djangofrom django.contrib.auth.mixins import (LoginRequiredMixin,PermissionRequiredMixin)-from django.urls import reverse_lazyfrom django.http import HttpResponseForbidden+from django.urls import reverse_lazyfrom django.utils.translation import (ugettext as _,ugettext_lazy@@ -38,9 +38,9 @@ from django.views.generic import (# wgerfrom wger.core.models import RepetitionUnitfrom wger.utils.generic_views import (+ UAAwareViewMixin,WgerDeleteMixin,- WgerFormMixin,- UAAwareViewMixin+ WgerFormMixin)diff --git a/wger/core/views/user.py b/wger/core/views/user.pyindex 25a261090..17b01123b 100644--- a/wger/core/views/user.py+++ b/wger/core/views/user.py@@ -17,7 +17,7 @@# Standard Libraryimport logging-# Third Party+# Djangofrom django.conf import settingsfrom django.contrib import messagesfrom django.contrib.auth import (@@ -32,13 +32,13 @@ from django.contrib.auth.mixins import ()from django.contrib.auth.models import Userfrom django.contrib.auth.views import LoginView-from django.urls import reversefrom django.http import (HttpResponseForbidden,HttpResponseRedirect)from django.shortcuts import get_object_or_404from django.template.context_processors import csrf+from django.urls import reversefrom django.utils import translationfrom django.utils.translation import (ugettext as _,@@ -50,6 +50,8 @@ from django.views.generic import (RedirectView,UpdateView)++# Third Partyfrom rest_framework.authtoken.models import Token# wger@@ -76,16 +78,16 @@ from wger.manager.models import (from wger.nutrition.models import NutritionPlanfrom wger.utils.constants import USER_TABfrom wger.utils.generic_views import (+ UAAwareViewMixin,WgerFormMixin,- WgerMultiplePermissionRequiredMixin,- UAAwareViewMixin+ WgerMultiplePermissionRequiredMixin)+from wger.utils.helpers import ua_aware_renderfrom wger.utils.user_agents import (check_request_amazon,check_request_android)from wger.weight.models import WeightEntry-from wger.utils.helpers import ua_aware_renderlogger = logging.getLogger(__name__)diff --git a/wger/core/views/weight_units.py b/wger/core/views/weight_units.pyindex 1393197e9..8a30a9ca8 100644--- a/wger/core/views/weight_units.py+++ b/wger/core/views/weight_units.py@@ -17,13 +17,13 @@# Standard Libraryimport logging-# Third Party+# Djangofrom django.contrib.auth.mixins import (LoginRequiredMixin,PermissionRequiredMixin)-from django.urls import reverse_lazyfrom django.http import HttpResponseForbidden+from django.urls import reverse_lazyfrom django.utils.translation import (ugettext as _,ugettext_lazy@@ -38,9 +38,9 @@ from django.views.generic import (# wgerfrom wger.core.models import WeightUnitfrom wger.utils.generic_views import (+ UAAwareViewMixin,WgerDeleteMixin,- WgerFormMixin,- UAAwareViewMixin+ WgerFormMixin)diff --git a/wger/email/__init__.py b/wger/email/__init__.pyindex 009b7dfe6..419385554 100644--- a/wger/email/__init__.py+++ b/wger/email/__init__.py@@ -15,7 +15,9 @@# You should have received a copy of the GNU Affero General Public License# along with Workout Manager. If not, see <http://www.gnu.org/licenses/>.+# wgerfrom wger import get_version+VERSION = get_version()default_app_config = 'wger.email.apps.Config'diff --git a/wger/email/apps.py b/wger/email/apps.pyindex 49f435257..7880ce4b4 100644--- a/wger/email/apps.py+++ b/wger/email/apps.py@@ -14,7 +14,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.apps import AppConfigdiff --git a/wger/email/forms.py b/wger/email/forms.pyindex 7bdc0acfa..3f977d3f7 100644--- a/wger/email/forms.py+++ b/wger/email/forms.py@@ -15,7 +15,7 @@# You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.forms import (CharField,Form,diff --git a/wger/email/management/commands/send-mass-emails.py b/wger/email/management/commands/send-mass-emails.pyindex 2e58a1a7a..5a6959548 100644--- a/wger/email/management/commands/send-mass-emails.py+++ b/wger/email/management/commands/send-mass-emails.py@@ -14,7 +14,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.conf import settingsfrom django.core import mailfrom django.core.management.base import BaseCommanddiff --git a/wger/email/models.py b/wger/email/models.pyindex 96e332e5c..e073b244c 100644--- a/wger/email/models.py+++ b/wger/email/models.py@@ -14,7 +14,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.contrib.auth.models import Userfrom django.db import modelsdiff --git a/wger/email/tests/test_gym_emails.py b/wger/email/tests/test_gym_emails.pyindex 6d29081bc..92d552593 100644--- a/wger/email/tests/test_gym_emails.py+++ b/wger/email/tests/test_gym_emails.py@@ -12,7 +12,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.urls import reverse# wgerdiff --git a/wger/email/urls.py b/wger/email/urls.pyindex e9c9db2d4..a7a022676 100644--- a/wger/email/urls.py+++ b/wger/email/urls.py@@ -14,7 +14,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.conf.urls import (include,urldiff --git a/wger/email/views/gym.py b/wger/email/views/gym.pyindex 44b951c08..8fc68a645 100644--- a/wger/email/views/gym.py+++ b/wger/email/views/gym.py@@ -14,17 +14,19 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.conf import settingsfrom django.contrib.auth.mixins import PermissionRequiredMixinfrom django.core import mail-from django.urls import reversefrom django.http import (HttpResponseForbidden,HttpResponseRedirect)from django.shortcuts import get_object_or_404+from django.urls import reversefrom django.views import generic++# Third Partyfrom formtools.preview import FormPreview# wgerdiff --git a/wger/exercises/__init__.py b/wger/exercises/__init__.pyindex 7d76565c1..1857b73d9 100644--- a/wger/exercises/__init__.py+++ b/wger/exercises/__init__.py@@ -16,7 +16,9 @@# along with Workout Manager. If not, see <http://www.gnu.org/licenses/>.+# wgerfrom wger import get_version+VERSION = get_version()default_app_config = 'wger.exercises.apps.ExerciseConfig'diff --git a/wger/exercises/admin.py b/wger/exercises/admin.pyindex 65a4b24cd..e86b9f238 100644--- a/wger/exercises/admin.py+++ b/wger/exercises/admin.py@@ -12,7 +12,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.contrib import admin# wgerdiff --git a/wger/exercises/api/views.py b/wger/exercises/api/views.pyindex 980841aa7..e270a43df 100644--- a/wger/exercises/api/views.py+++ b/wger/exercises/api/views.py@@ -15,8 +15,10 @@# You should have received a copy of the GNU Affero General Public License# along with Workout Manager. If not, see <http://www.gnu.org/licenses/>.-# Third Party+# Djangofrom django.utils.translation import ugettext as _++# Third Partyfrom easy_thumbnails.alias import aliasesfrom easy_thumbnails.files import get_thumbnailerfrom rest_framework import viewsetsdiff --git a/wger/exercises/apps.py b/wger/exercises/apps.pyindex bd2ef6da7..7604dac84 100644--- a/wger/exercises/apps.py+++ b/wger/exercises/apps.py@@ -14,7 +14,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.apps import AppConfigdiff --git a/wger/exercises/forms.py b/wger/exercises/forms.pyindex 4229856dd..180847eea 100644--- a/wger/exercises/forms.py+++ b/wger/exercises/forms.py@@ -14,7 +14,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django import forms# wgerdiff --git a/wger/exercises/management/commands/download-exercise-images.py b/wger/exercises/management/commands/download-exercise-images.pyindex 5488fbfa9..373476d04 100644--- a/wger/exercises/management/commands/download-exercise-images.py+++ b/wger/exercises/management/commands/download-exercise-images.py@@ -17,8 +17,7 @@# Standard Libraryimport os-# Third Party-import requests+# Djangofrom django.conf import settingsfrom django.core.exceptions import (ImproperlyConfigured,@@ -31,6 +30,9 @@ from django.core.management.base import (CommandError)from django.core.validators import URLValidator++# Third Party+import requestsfrom requests.utils import default_user_agent# wgerdiff --git a/wger/exercises/management/commands/redo-capitalize-names.py b/wger/exercises/management/commands/redo-capitalize-names.pyindex 8dbdcaa95..224c8ab75 100644--- a/wger/exercises/management/commands/redo-capitalize-names.py+++ b/wger/exercises/management/commands/redo-capitalize-names.py@@ -14,7 +14,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.core.management.base import BaseCommand# wgerdiff --git a/wger/exercises/management/commands/submitted-exercises.py b/wger/exercises/management/commands/submitted-exercises.pyindex 480991efb..8b3b29a34 100644--- a/wger/exercises/management/commands/submitted-exercises.py+++ b/wger/exercises/management/commands/submitted-exercises.py@@ -14,7 +14,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.core.management.base import BaseCommand# wgerdiff --git a/wger/exercises/models.py b/wger/exercises/models.pyindex 5321f41ec..51c4c9b8a 100644--- a/wger/exercises/models.py+++ b/wger/exercises/models.py@@ -19,21 +19,23 @@import loggingimport uuid-# Third Party-import bleach+# Djangofrom django.conf import settingsfrom django.contrib.auth.models import Userfrom django.contrib.sites.models import Sitefrom django.core import mailfrom django.core.cache import cache-from django.urls import reversefrom django.core.validators import MinLengthValidatorfrom django.db import modelsfrom django.template.loader import render_to_string+from django.urls import reversefrom django.utils import translationfrom django.utils.text import slugifyfrom django.utils.translation import ugettext_lazy as _+# Third Party+import bleach+# wgerfrom wger.core.models import Languagefrom wger.utils.cache import (diff --git a/wger/exercises/signals.py b/wger/exercises/signals.pyindex 3c0d13ce3..dd0b6673e 100644--- a/wger/exercises/signals.py+++ b/wger/exercises/signals.py@@ -15,12 +15,14 @@# You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.db.models.signals import (post_delete,pre_save)from django.dispatch import receiver++# Third Partyfrom easy_thumbnails.files import get_thumbnailerfrom easy_thumbnails.signal_handlers import generate_aliasesfrom easy_thumbnails.signals import saved_filediff --git a/wger/exercises/sitemap.py b/wger/exercises/sitemap.pyindex a09e4a3d1..a19f8bc4f 100644--- a/wger/exercises/sitemap.py+++ b/wger/exercises/sitemap.py@@ -14,7 +14,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.contrib.sitemaps import Sitemap# wgerdiff --git a/wger/exercises/tests/test_categories.py b/wger/exercises/tests/test_categories.pyindex c94dc3903..f1891d8bd 100644--- a/wger/exercises/tests/test_categories.py+++ b/wger/exercises/tests/test_categories.py@@ -12,7 +12,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.core.cache import cachefrom django.urls import reversediff --git a/wger/exercises/tests/test_corrected_exercise.py b/wger/exercises/tests/test_corrected_exercise.pyindex 98f9daf80..5c2923f65 100644--- a/wger/exercises/tests/test_corrected_exercise.py+++ b/wger/exercises/tests/test_corrected_exercise.py@@ -12,7 +12,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.core import mailfrom django.urls import reversediff --git a/wger/exercises/tests/test_equipment.py b/wger/exercises/tests/test_equipment.pyindex 15681fbb6..8dfa2c2fb 100644--- a/wger/exercises/tests/test_equipment.py+++ b/wger/exercises/tests/test_equipment.py@@ -13,7 +13,7 @@# You should have received a copy of the GNU Affero General Public License# along with Workout Manager. If not, see <http://www.gnu.org/licenses/>.-# Third Party+# Djangofrom django.core.cache import cachefrom django.urls import reversediff --git a/wger/exercises/tests/test_exercise.py b/wger/exercises/tests/test_exercise.pyindex a9f0ce236..be824602d 100644--- a/wger/exercises/tests/test_exercise.py+++ b/wger/exercises/tests/test_exercise.py@@ -15,7 +15,7 @@# Standard Libraryimport json-# Third Party+# Djangofrom django.core import mailfrom django.core.cache import cachefrom django.urls import reversediff --git a/wger/exercises/tests/test_exercise_comments.py b/wger/exercises/tests/test_exercise_comments.pyindex 43039f47e..a96dd18c8 100644--- a/wger/exercises/tests/test_exercise_comments.py+++ b/wger/exercises/tests/test_exercise_comments.py@@ -13,7 +13,7 @@# You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.core.cache import cachefrom django.urls import reversediff --git a/wger/exercises/tests/test_exercise_images.py b/wger/exercises/tests/test_exercise_images.pyindex 20fdc9d08..5b481c7f9 100644--- a/wger/exercises/tests/test_exercise_images.py+++ b/wger/exercises/tests/test_exercise_images.py@@ -12,7 +12,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.core.files import Filefrom django.urls import reversediff --git a/wger/exercises/tests/test_muscles.py b/wger/exercises/tests/test_muscles.pyindex 354ec3920..d6a4b6198 100644--- a/wger/exercises/tests/test_muscles.py+++ b/wger/exercises/tests/test_muscles.py@@ -13,7 +13,7 @@# You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.core.cache import cachefrom django.urls import reversediff --git a/wger/exercises/tests/test_submitted_exercise.py b/wger/exercises/tests/test_submitted_exercise.pyindex cf3f0ecd9..f650ff913 100644--- a/wger/exercises/tests/test_submitted_exercise.py+++ b/wger/exercises/tests/test_submitted_exercise.py@@ -12,7 +12,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.core import mailfrom django.urls import reversediff --git a/wger/exercises/tests/test_submitted_image.py b/wger/exercises/tests/test_submitted_image.pyindex bb796ed9a..53eb568e5 100644--- a/wger/exercises/tests/test_submitted_image.py+++ b/wger/exercises/tests/test_submitted_image.py@@ -12,7 +12,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.core import mailfrom django.urls import reversediff --git a/wger/exercises/urls.py b/wger/exercises/urls.pyindex 7d0dfff98..699f21072 100644--- a/wger/exercises/urls.py+++ b/wger/exercises/urls.py@@ -15,7 +15,7 @@# You should have received a copy of the GNU Affero General Public License# along with Workout Manager. If not, see <http://www.gnu.org/licenses/>.-# Third Party+# Djangofrom django.conf.urls import (include,urldiff --git a/wger/exercises/views/categories.py b/wger/exercises/views/categories.pyindex 65f4d8aa4..ecebd051b 100644--- a/wger/exercises/views/categories.py+++ b/wger/exercises/views/categories.py@@ -17,7 +17,7 @@# Standard Libraryimport logging-# Third Party+# Djangofrom django.contrib.auth.mixins import (LoginRequiredMixin,PermissionRequiredMixin@@ -40,9 +40,9 @@ from django.views.generic import (# wgerfrom wger.exercises.models import ExerciseCategoryfrom wger.utils.generic_views import (+ UAAwareViewMixin,WgerDeleteMixin,- WgerFormMixin,- UAAwareViewMixin+ WgerFormMixin)from wger.utils.language import load_languagediff --git a/wger/exercises/views/comments.py b/wger/exercises/views/comments.pyindex a816bef35..b66d5261c 100644--- a/wger/exercises/views/comments.py+++ b/wger/exercises/views/comments.py@@ -17,15 +17,15 @@# Standard Libraryimport logging-# Third Party+# Djangofrom django.contrib.auth.decorators import permission_requiredfrom django.contrib.auth.mixins import (LoginRequiredMixin,PermissionRequiredMixin)-from django.urls import reversefrom django.http import HttpResponseRedirectfrom django.shortcuts import get_object_or_404+from django.urls import reversefrom django.utils.translation import ugettext_lazyfrom django.views.generic import (CreateView,diff --git a/wger/exercises/views/equipment.py b/wger/exercises/views/equipment.pyindex 0ccc7b88d..aff554757 100644--- a/wger/exercises/views/equipment.py+++ b/wger/exercises/views/equipment.py@@ -17,7 +17,7 @@# Standard Libraryimport logging-# Third Party+# Djangofrom django.contrib.auth.mixins import (LoginRequiredMixin,PermissionRequiredMixin@@ -42,9 +42,9 @@ from wger.config.models import LanguageConfigfrom wger.exercises.models import Equipmentfrom wger.utils.constants import PAGINATION_OBJECTS_PER_PAGEfrom wger.utils.generic_views import (+ UAAwareViewMixin,WgerDeleteMixin,- WgerFormMixin,- UAAwareViewMixin+ WgerFormMixin)from wger.utils.language import load_item_languagesdiff --git a/wger/exercises/views/exercises.py b/wger/exercises/views/exercises.pyindex 17f126883..4ab5fbc70 100644--- a/wger/exercises/views/exercises.py+++ b/wger/exercises/views/exercises.py@@ -17,20 +17,16 @@import loggingimport uuid-# Third Party+# Django+from django.conf import settingsfrom django.contrib import messagesfrom django.contrib.auth.decorators import permission_requiredfrom django.contrib.auth.mixins import (LoginRequiredMixin,PermissionRequiredMixin)-from django.conf import settingsfrom django.core import mailfrom django.core.cache import cache-from django.urls import (- reverse,- reverse_lazy-)from django.forms import (ModelChoiceField,ModelForm,@@ -42,6 +38,11 @@ from django.http import ()from django.shortcuts import get_object_or_404from django.template.loader import render_to_string+from django.urls import (+ reverse,+ reverse_lazy+)+from django.utils.cache import patch_vary_headersfrom django.utils.translation import (ugettext as _,ugettext_lazy@@ -52,7 +53,6 @@ from django.views.generic import (ListView,UpdateView)-from django.utils.cache import patch_vary_headers# wgerfrom wger.config.models import LanguageConfig@@ -64,10 +64,11 @@ from wger.exercises.models import (from wger.manager.models import WorkoutLogfrom wger.utils.cache import cache_mapperfrom wger.utils.generic_views import (- WgerDeleteMixin,- WgerFormMixin,UAAwareViewMixin,+ WgerDeleteMixin,+ WgerFormMixin)+from wger.utils.helpers import ua_aware_renderfrom wger.utils.language import (load_item_languages,load_language@@ -78,7 +79,7 @@ from wger.utils.widgets import (TranslatedSelectMultiple)from wger.weight.helpers import process_log_entries-from wger.utils.helpers import ua_aware_render+logger = logging.getLogger(__name__)diff --git a/wger/exercises/views/images.py b/wger/exercises/views/images.pyindex 5a7aeb5b0..d7bdcc6a9 100644--- a/wger/exercises/views/images.py+++ b/wger/exercises/views/images.py@@ -17,15 +17,15 @@# Standard Libraryimport logging-# Third Party+# Djangofrom django.contrib.auth.decorators import permission_requiredfrom django.contrib.auth.mixins import (LoginRequiredMixin,PermissionRequiredMixin)-from django.urls import reversefrom django.http import HttpResponseRedirectfrom django.shortcuts import get_object_or_404+from django.urls import reversefrom django.utils.translation import (ugettext as _,ugettext_lazydiff --git a/wger/exercises/views/muscles.py b/wger/exercises/views/muscles.pyindex 0af94eb7c..879e5aea1 100644--- a/wger/exercises/views/muscles.py+++ b/wger/exercises/views/muscles.py@@ -17,7 +17,7 @@# Standard Libraryimport logging-# Third Party+# Djangofrom django.contrib.auth.mixins import (LoginRequiredMixin,PermissionRequiredMixin@@ -41,9 +41,9 @@ from django.views.generic import (from wger.config.models import LanguageConfigfrom wger.exercises.models import Musclefrom wger.utils.generic_views import (+ UAAwareViewMixin,WgerDeleteMixin,- WgerFormMixin,- UAAwareViewMixin+ WgerFormMixin)from wger.utils.language import load_item_languagesdiff --git a/wger/gym/__init__.py b/wger/gym/__init__.pyindex 48d808608..869912bd4 100644--- a/wger/gym/__init__.py+++ b/wger/gym/__init__.py@@ -15,7 +15,9 @@# You should have received a copy of the GNU Affero General Public License# along with Workout Manager. If not, see <http://www.gnu.org/licenses/>.+# wgerfrom wger import get_version+VERSION = get_version()default_app_config = 'wger.gym.apps.GymConfig'diff --git a/wger/gym/apps.py b/wger/gym/apps.pyindex 705c949cb..dd6a783a5 100644--- a/wger/gym/apps.py+++ b/wger/gym/apps.py@@ -14,7 +14,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.apps import AppConfigdiff --git a/wger/gym/forms.py b/wger/gym/forms.pyindex c4010ae9b..196786392 100644--- a/wger/gym/forms.py+++ b/wger/gym/forms.py@@ -14,7 +14,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django import formsfrom django.contrib.auth.models import Userfrom django.utils.translation import ugettext as _diff --git a/wger/gym/management/commands/gym-user-config.py b/wger/gym/management/commands/gym-user-config.pyindex 2af1ddbd9..05ffc3e24 100644--- a/wger/gym/management/commands/gym-user-config.py+++ b/wger/gym/management/commands/gym-user-config.py@@ -14,7 +14,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.contrib.auth.models import Userfrom django.core.exceptions import ObjectDoesNotExistfrom django.core.management.base import BaseCommanddiff --git a/wger/gym/management/commands/inactive-members.py b/wger/gym/management/commands/inactive-members.pyindex 51898bab8..f6303a77f 100644--- a/wger/gym/management/commands/inactive-members.py+++ b/wger/gym/management/commands/inactive-members.py@@ -17,7 +17,7 @@# Standard Libraryimport datetime-# Third Party+# Djangofrom django.conf import settingsfrom django.core import mailfrom django.core.management.base import BaseCommanddiff --git a/wger/gym/managers.py b/wger/gym/managers.pyindex f531b3082..8caf3996f 100644--- a/wger/gym/managers.py+++ b/wger/gym/managers.py@@ -14,7 +14,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.contrib.auth.models import (Permission,Userdiff --git a/wger/gym/models.py b/wger/gym/models.pyindex 715a323f4..fdb96891f 100644--- a/wger/gym/models.py+++ b/wger/gym/models.py@@ -18,10 +18,10 @@import datetimeimport uuid-# Third Party+# Djangofrom django.contrib.auth.models import User-from django.urls import reversefrom django.db import models as m+from django.urls import reversefrom django.utils.translation import (ugettext,ugettext_lazy as _diff --git a/wger/gym/signals.py b/wger/gym/signals.pyindex c51dbb30c..f51c0389b 100644--- a/wger/gym/signals.py+++ b/wger/gym/signals.py@@ -15,7 +15,7 @@# You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.db.models.signals import (post_delete,post_savediff --git a/wger/gym/tests/test_admin_user_notes.py b/wger/gym/tests/test_admin_user_notes.pyindex 90ae28fa9..27e8fb45f 100644--- a/wger/gym/tests/test_admin_user_notes.py+++ b/wger/gym/tests/test_admin_user_notes.py@@ -12,7 +12,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.urls import reverse_lazy# wgerdiff --git a/wger/gym/tests/test_contract_options.py b/wger/gym/tests/test_contract_options.pyindex 257c24bde..0c1f05472 100644--- a/wger/gym/tests/test_contract_options.py+++ b/wger/gym/tests/test_contract_options.py@@ -12,7 +12,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.urls import reverse# wgerdiff --git a/wger/gym/tests/test_contract_types.py b/wger/gym/tests/test_contract_types.pyindex 484088a4a..ca1bf6a05 100644--- a/wger/gym/tests/test_contract_types.py+++ b/wger/gym/tests/test_contract_types.py@@ -12,7 +12,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.urls import reverse# wgerdiff --git a/wger/gym/tests/test_contracts.py b/wger/gym/tests/test_contracts.pyindex c039872dd..216cc76c9 100644--- a/wger/gym/tests/test_contracts.py+++ b/wger/gym/tests/test_contracts.py@@ -12,7 +12,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.urls import reverse# wgerdiff --git a/wger/gym/tests/test_export.py b/wger/gym/tests/test_export.pyindex 11b50586d..4768b7159 100644--- a/wger/gym/tests/test_export.py+++ b/wger/gym/tests/test_export.py@@ -15,7 +15,7 @@# Standard Libraryimport datetime-# Third Party+# Djangofrom django.urls import reverse# wgerdiff --git a/wger/gym/tests/test_gym.py b/wger/gym/tests/test_gym.pyindex 8e6bf13ee..2e14d364f 100644--- a/wger/gym/tests/test_gym.py+++ b/wger/gym/tests/test_gym.py@@ -13,7 +13,7 @@# You should have received a copy of the GNU Affero General Public License# along with Workout Manager. If not, see <http://www.gnu.org/licenses/>.-# Third Party+# Djangofrom django.urls import reverse_lazy# wgerdiff --git a/wger/gym/tests/test_inactive_members.py b/wger/gym/tests/test_inactive_members.pyindex c40212aac..538d7b006 100644--- a/wger/gym/tests/test_inactive_members.py+++ b/wger/gym/tests/test_inactive_members.py@@ -12,7 +12,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.core import mailfrom django.core.management import call_commanddiff --git a/wger/gym/tests/test_user.py b/wger/gym/tests/test_user.pyindex def324db5..7191f2343 100644--- a/wger/gym/tests/test_user.py+++ b/wger/gym/tests/test_user.py@@ -15,7 +15,7 @@# Standard Libraryimport datetime-# Third Party+# Djangofrom django.contrib.auth.models import (Permission,Userdiff --git a/wger/gym/tests/test_user_documents.py b/wger/gym/tests/test_user_documents.pyindex 77e0a254b..992f9dea6 100644--- a/wger/gym/tests/test_user_documents.py+++ b/wger/gym/tests/test_user_documents.py@@ -12,7 +12,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.urls import reverse# wgerdiff --git a/wger/gym/tests/test_user_last_activity.py b/wger/gym/tests/test_user_last_activity.pyindex 4bcf1e058..c142cbafa 100644--- a/wger/gym/tests/test_user_last_activity.py+++ b/wger/gym/tests/test_user_last_activity.py@@ -15,7 +15,7 @@# Standard Libraryimport datetime-# Third Party+# Djangofrom django.contrib.auth.models import User# wgerdiff --git a/wger/gym/urls.py b/wger/gym/urls.pyindex 9cc3dc696..2c5d315fb 100644--- a/wger/gym/urls.py+++ b/wger/gym/urls.py@@ -15,7 +15,7 @@# You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.conf.urls import (include,urldiff --git a/wger/gym/views/admin_config.py b/wger/gym/views/admin_config.pyindex 578e39918..795880ba0 100644--- a/wger/gym/views/admin_config.py+++ b/wger/gym/views/admin_config.py@@ -17,7 +17,7 @@# Standard Libraryimport logging-# Third Party+# Djangofrom django.urls import reversefrom django.utils.translation import ugettext as _from django.views.generic import UpdateViewdiff --git a/wger/gym/views/admin_notes.py b/wger/gym/views/admin_notes.pyindex 8da74496a..57544a376 100644--- a/wger/gym/views/admin_notes.py+++ b/wger/gym/views/admin_notes.py@@ -17,14 +17,14 @@# Standard Libraryimport logging-# Third Party+# Djangofrom django.contrib.auth.mixins import (LoginRequiredMixin,PermissionRequiredMixin)from django.contrib.auth.models import User-from django.urls import reversefrom django.http.response import HttpResponseForbidden+from django.urls import reversefrom django.utils.translation import (ugettext as _,ugettext_lazy@@ -39,9 +39,9 @@ from django.views.generic import (# wgerfrom wger.gym.models import AdminUserNotefrom wger.utils.generic_views import (+ UAAwareViewMixin,WgerDeleteMixin,- WgerFormMixin,- UAAwareViewMixin+ WgerFormMixin)diff --git a/wger/gym/views/config.py b/wger/gym/views/config.pyindex 6fd60a8c0..14d73862f 100644--- a/wger/gym/views/config.py+++ b/wger/gym/views/config.py@@ -17,13 +17,13 @@# Standard Libraryimport logging-# Third Party+# Djangofrom django.contrib.auth.mixins import (LoginRequiredMixin,PermissionRequiredMixin)-from django.urls import reversefrom django.http.response import HttpResponseForbidden+from django.urls import reversefrom django.utils.translation import ugettext as _from django.views.generic import UpdateViewdiff --git a/wger/gym/views/contract.py b/wger/gym/views/contract.pyindex 36a666ccc..8e1ed7f00 100644--- a/wger/gym/views/contract.py+++ b/wger/gym/views/contract.py@@ -17,15 +17,15 @@# Standard Libraryimport logging-# Third Party+# Djangofrom django.contrib.auth.mixins import (LoginRequiredMixin,PermissionRequiredMixin)from django.contrib.auth.models import User-from django.urls import reversefrom django.http.response import HttpResponseForbiddenfrom django.shortcuts import get_object_or_404+from django.urls import reversefrom django.utils.translation import (ugettext as _,ugettext_lazy@@ -40,8 +40,8 @@ from django.views.generic import (# wgerfrom wger.gym.models import Contractfrom wger.utils.generic_views import (- WgerFormMixin,- UAAwareViewMixin+ UAAwareViewMixin,+ WgerFormMixin)diff --git a/wger/gym/views/contract_option.py b/wger/gym/views/contract_option.pyindex 83772a9f8..772dedd81 100644--- a/wger/gym/views/contract_option.py+++ b/wger/gym/views/contract_option.py@@ -17,14 +17,14 @@# Standard Libraryimport logging-# Third Party+# Djangofrom django.contrib.auth.mixins import (LoginRequiredMixin,PermissionRequiredMixin)-from django.urls import reversefrom django.http.response import HttpResponseForbiddenfrom django.shortcuts import get_object_or_404+from django.urls import reversefrom django.utils.translation import (ugettext as _,ugettext_lazy@@ -42,9 +42,9 @@ from wger.gym.models import (Gym)from wger.utils.generic_views import (+ UAAwareViewMixin,WgerDeleteMixin,- WgerFormMixin,- UAAwareViewMixin+ WgerFormMixin)diff --git a/wger/gym/views/contract_type.py b/wger/gym/views/contract_type.pyindex eaccc60c6..ee89a947e 100644--- a/wger/gym/views/contract_type.py+++ b/wger/gym/views/contract_type.py@@ -17,14 +17,14 @@# Standard Libraryimport logging-# Third Party+# Djangofrom django.contrib.auth.mixins import (LoginRequiredMixin,PermissionRequiredMixin)-from django.urls import reversefrom django.http.response import HttpResponseForbiddenfrom django.shortcuts import get_object_or_404+from django.urls import reversefrom django.utils.translation import (ugettext as _,ugettext_lazy@@ -42,9 +42,9 @@ from wger.gym.models import (Gym)from wger.utils.generic_views import (+ UAAwareViewMixin,WgerDeleteMixin,- WgerFormMixin,- UAAwareViewMixin+ WgerFormMixin)diff --git a/wger/gym/views/document.py b/wger/gym/views/document.pyindex 4b9dd1372..aa8ef60a7 100644--- a/wger/gym/views/document.py+++ b/wger/gym/views/document.py@@ -17,14 +17,14 @@# Standard Libraryimport logging-# Third Party+# Djangofrom django.contrib.auth.mixins import (LoginRequiredMixin,PermissionRequiredMixin)from django.contrib.auth.models import User-from django.urls import reversefrom django.http.response import HttpResponseForbidden+from django.urls import reversefrom django.utils.translation import (ugettext as _,ugettext_lazy@@ -39,9 +39,9 @@ from django.views.generic import (# wgerfrom wger.gym.models import UserDocumentfrom wger.utils.generic_views import (+ UAAwareViewMixin,WgerDeleteMixin,- WgerFormMixin,- UAAwareViewMixin+ WgerFormMixin)diff --git a/wger/gym/views/export.py b/wger/gym/views/export.pyindex 404269bbd..55165050b 100644--- a/wger/gym/views/export.py+++ b/wger/gym/views/export.py@@ -19,7 +19,7 @@ import csvimport datetimeimport logging-# Third Party+# Djangofrom django.contrib.auth.decorators import login_requiredfrom django.http.response import (HttpResponse,diff --git a/wger/gym/views/gym.py b/wger/gym/views/gym.pyindex 01d885213..97cf80c44 100644--- a/wger/gym/views/gym.py+++ b/wger/gym/views/gym.py@@ -20,7 +20,7 @@ import csvimport datetimeimport logging-# Third Party+# Djangofrom django.contrib.auth.decorators import login_requiredfrom django.contrib.auth.mixins import (LoginRequiredMixin,@@ -30,16 +30,16 @@ from django.contrib.auth.models import (Group,User)-from django.urls import (- reverse,- reverse_lazy-)from django.http.response import (HttpResponse,HttpResponseForbidden,HttpResponseRedirect)from django.shortcuts import get_object_or_404+from django.urls import (+ reverse,+ reverse_lazy+)from django.utils.translation import (ugettext as _,ugettext_lazy@@ -67,16 +67,17 @@ from wger.gym.models import (GymUserConfig)from wger.utils.generic_views import (+ UAAwareViewMixin,WgerDeleteMixin,WgerFormMixin,- WgerMultiplePermissionRequiredMixin,- UAAwareViewMixin+ WgerMultiplePermissionRequiredMixin)from wger.utils.helpers import (password_generator,ua_aware_render)+logger = logging.getLogger(__name__)diff --git a/wger/gym/views/user_config.py b/wger/gym/views/user_config.pyindex fdb8a4ee6..09fdc7bbf 100644--- a/wger/gym/views/user_config.py+++ b/wger/gym/views/user_config.py@@ -17,13 +17,13 @@# Standard Libraryimport logging-# Third Party+# Djangofrom django.contrib.auth.mixins import (LoginRequiredMixin,PermissionRequiredMixin)-from django.urls import reversefrom django.http import HttpResponseForbidden+from django.urls import reversefrom django.utils.translation import ugettext as _from django.views.generic import UpdateViewdiff --git a/wger/manager/__init__.py b/wger/manager/__init__.pyindex e83a37b58..aa1e7304c 100644--- a/wger/manager/__init__.py+++ b/wger/manager/__init__.py@@ -16,7 +16,9 @@# along with Workout Manager. If not, see <http://www.gnu.org/licenses/>.+# wgerfrom wger import get_version+VERSION = get_version()default_app_config = 'wger.manager.apps.ManagerConfig'diff --git a/wger/manager/admin.py b/wger/manager/admin.pyindex 8b6065b10..b31c485f6 100644--- a/wger/manager/admin.py+++ b/wger/manager/admin.py@@ -13,7 +13,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.contrib import admin# wgerdiff --git a/wger/manager/apps.py b/wger/manager/apps.pyindex bebac364f..863d5e805 100644--- a/wger/manager/apps.py+++ b/wger/manager/apps.py@@ -14,7 +14,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.apps import AppConfigdiff --git a/wger/manager/forms.py b/wger/manager/forms.pyindex 0bf01309f..d6544af06 100644--- a/wger/manager/forms.py+++ b/wger/manager/forms.py@@ -18,8 +18,7 @@This file contains forms used in the application'''-# Third Party-from captcha.fields import ReCaptchaField+# Djangofrom django.forms import (CharField,DateField,@@ -33,6 +32,9 @@ from django.forms import ()from django.utils.translation import ugettext as _+# Third Party+from captcha.fields import ReCaptchaField+# wgerfrom wger.core.models import (RepetitionUnit,diff --git a/wger/manager/helpers.py b/wger/manager/helpers.pyindex 002e62022..f275a39d6 100644--- a/wger/manager/helpers.py+++ b/wger/manager/helpers.py@@ -19,9 +19,11 @@import datetimefrom calendar import HTMLCalendar-# Third Party+# Djangofrom django.urls import reversefrom django.utils.translation import ugettext as _++# Third Partyfrom reportlab.lib import colorsfrom reportlab.lib.units import cmfrom reportlab.platypus import (diff --git a/wger/manager/management/commands/email-reminders.py b/wger/manager/management/commands/email-reminders.pyindex aee8887df..120149ac5 100644--- a/wger/manager/management/commands/email-reminders.py+++ b/wger/manager/management/commands/email-reminders.py@@ -17,7 +17,7 @@# Standard Libraryimport datetime-# Third Party+# Djangofrom django.conf import settingsfrom django.contrib.sites.models import Sitefrom django.core import maildiff --git a/wger/manager/models.py b/wger/manager/models.pyindex 9b011518b..a1e0408ae 100644--- a/wger/manager/models.py+++ b/wger/manager/models.py@@ -19,20 +19,22 @@import datetimeimport logging-# Third Party+# Djangofrom django.contrib.auth.models import Userfrom django.core.cache import cachefrom django.core.exceptions import (ObjectDoesNotExist,ValidationError)-from django.urls import reversefrom django.core.validators import (MaxValueValidator,MinValueValidator)from django.db import models+from django.urls import reversefrom django.utils.translation import ugettext_lazy as _++# Third Partyfrom sortedm2m.fields import SortedManyToManyField# wgerdiff --git a/wger/manager/signals.py b/wger/manager/signals.pyindex 2a6649c08..0a27c10c9 100644--- a/wger/manager/signals.py+++ b/wger/manager/signals.py@@ -14,7 +14,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.db.models import Qfrom django.db.models.signals import (post_save,diff --git a/wger/manager/tests/__init__.py b/wger/manager/tests/__init__.pyindex a915bb265..46a91e9bd 100644--- a/wger/manager/tests/__init__.py+++ b/wger/manager/tests/__init__.py@@ -16,6 +16,8 @@# along with Workout Manager. If not, see <http://www.gnu.org/licenses/>.+# wgerfrom wger import get_version+VERSION = get_version()diff --git a/wger/manager/tests/test_copy_workout.py b/wger/manager/tests/test_copy_workout.pyindex 9c19de5ab..1859d7c4d 100644--- a/wger/manager/tests/test_copy_workout.py+++ b/wger/manager/tests/test_copy_workout.py@@ -15,7 +15,7 @@# Standard Libraryimport logging-# Third Party+# Djangofrom django.urls import reverse# wgerdiff --git a/wger/manager/tests/test_day.py b/wger/manager/tests/test_day.pyindex 23c9a3606..4425dcd92 100644--- a/wger/manager/tests/test_day.py+++ b/wger/manager/tests/test_day.py@@ -12,7 +12,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.core.cache import cachefrom django.urls import reversediff --git a/wger/manager/tests/test_email_reminder.py b/wger/manager/tests/test_email_reminder.pyindex 015784bdc..94b2b31f9 100644--- a/wger/manager/tests/test_email_reminder.py+++ b/wger/manager/tests/test_email_reminder.py@@ -15,7 +15,7 @@# Standard Libraryimport datetime-# Third Party+# Djangofrom django.contrib.auth.models import Userfrom django.core import mailfrom django.core.management import call_commanddiff --git a/wger/manager/tests/test_ical.py b/wger/manager/tests/test_ical.pyindex ef8095955..21b49c04f 100644--- a/wger/manager/tests/test_ical.py+++ b/wger/manager/tests/test_ical.py@@ -15,7 +15,7 @@# Standard Libraryimport datetime-# Third Party+# Djangofrom django.contrib.auth.models import Userfrom django.urls import reversediff --git a/wger/manager/tests/test_pdf.py b/wger/manager/tests/test_pdf.pyindex 6a4208965..aec560e97 100644--- a/wger/manager/tests/test_pdf.py+++ b/wger/manager/tests/test_pdf.py@@ -12,7 +12,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.contrib.auth.models import Userfrom django.urls import reversediff --git a/wger/manager/tests/test_schedule.py b/wger/manager/tests/test_schedule.pyindex ea847a4f6..0c88cefce 100644--- a/wger/manager/tests/test_schedule.py+++ b/wger/manager/tests/test_schedule.py@@ -16,7 +16,7 @@import datetimeimport logging-# Third Party+# Djangofrom django.contrib.auth.models import Userfrom django.urls import reversediff --git a/wger/manager/tests/test_schedule_step.py b/wger/manager/tests/test_schedule_step.pyindex 972ae5e70..c2d8681a4 100644--- a/wger/manager/tests/test_schedule_step.py+++ b/wger/manager/tests/test_schedule_step.py@@ -15,7 +15,7 @@# Standard Libraryimport datetime-# Third Party+# Djangofrom django.urls import reverse_lazy# wgerdiff --git a/wger/manager/tests/test_set.py b/wger/manager/tests/test_set.pyindex 5a82e20ac..24e3dcebd 100644--- a/wger/manager/tests/test_set.py+++ b/wger/manager/tests/test_set.py@@ -15,7 +15,7 @@# Standard Libraryimport logging-# Third Party+# Djangofrom django.core.cache import cachefrom django.urls import (reverse,diff --git a/wger/manager/tests/test_timer.py b/wger/manager/tests/test_timer.pyindex 5360d4939..5ec183cbb 100644--- a/wger/manager/tests/test_timer.py+++ b/wger/manager/tests/test_timer.py@@ -18,7 +18,7 @@ import loggingimport mathfrom decimal import Decimal-# Third Party+# Djangofrom django.contrib.auth.models import Userfrom django.urls import reversediff --git a/wger/manager/tests/test_weight_log.py b/wger/manager/tests/test_weight_log.pyindex 0558dd9dc..48e712b99 100644--- a/wger/manager/tests/test_weight_log.py+++ b/wger/manager/tests/test_weight_log.py@@ -16,7 +16,7 @@import datetimeimport logging-# Third Party+# Djangofrom django.contrib.auth.models import Userfrom django.core.cache import cachefrom django.urls import (diff --git a/wger/manager/tests/test_workout.py b/wger/manager/tests/test_workout.pyindex 80d9dfdec..37d024d18 100644--- a/wger/manager/tests/test_workout.py+++ b/wger/manager/tests/test_workout.py@@ -15,7 +15,7 @@# Standard Libraryimport datetime-# Third Party+# Djangofrom django.urls import reverse# wgerdiff --git a/wger/manager/tests/test_workout_canonical.py b/wger/manager/tests/test_workout_canonical.pyindex 4259dbe83..2fda71402 100644--- a/wger/manager/tests/test_workout_canonical.py+++ b/wger/manager/tests/test_workout_canonical.py@@ -15,7 +15,7 @@# Standard Libraryfrom decimal import Decimal-# Third Party+# Djangofrom django.core.cache import cache# wgerdiff --git a/wger/manager/tests/test_workout_session.py b/wger/manager/tests/test_workout_session.pyindex cb9615071..d0f5b7d64 100644--- a/wger/manager/tests/test_workout_session.py+++ b/wger/manager/tests/test_workout_session.py@@ -15,7 +15,7 @@# Standard Libraryimport datetime-# Third Party+# Djangofrom django.contrib.auth.models import Userfrom django.core.cache import cachefrom django.core.exceptions import ValidationErrordiff --git a/wger/manager/urls.py b/wger/manager/urls.pyindex 19b4a9242..3245fab66 100644--- a/wger/manager/urls.py+++ b/wger/manager/urls.py@@ -15,7 +15,7 @@# You should have received a copy of the GNU Affero General Public License# along with Workout Manager. If not, see <http://www.gnu.org/licenses/>.-# Third Party+# Djangofrom django.conf.urls import (include,urldiff --git a/wger/manager/views/day.py b/wger/manager/views/day.pyindex e941659ee..032ca9725 100644--- a/wger/manager/views/day.py+++ b/wger/manager/views/day.py@@ -17,12 +17,12 @@# Standard Libraryimport logging-# Third Party+# Djangofrom django.contrib.auth.decorators import login_requiredfrom django.contrib.auth.mixins import LoginRequiredMixin-from django.urls import reversefrom django.http import HttpResponseRedirectfrom django.shortcuts import get_object_or_404+from django.urls import reversefrom django.utils.translation import (ugettext as _,ugettext_lazydiff --git a/wger/manager/views/ical.py b/wger/manager/views/ical.pyindex 53d0329e5..81589af53 100644--- a/wger/manager/views/ical.py+++ b/wger/manager/views/ical.py@@ -18,13 +18,15 @@import datetimeimport logging-# Third Party+# Djangofrom django.contrib.sites.models import Sitefrom django.http import (HttpResponse,HttpResponseForbidden)from django.shortcuts import get_object_or_404++# Third Partyfrom icalendar import (Calendar,Eventdiff --git a/wger/manager/views/log.py b/wger/manager/views/log.pyindex 57b34cdf9..eef181f05 100644--- a/wger/manager/views/log.py+++ b/wger/manager/views/log.py@@ -19,12 +19,8 @@ import datetimeimport loggingimport uuid-# Third Party+# Djangofrom django.contrib.auth.mixins import LoginRequiredMixin-from django.urls import (- reverse,- reverse_lazy-)from django.forms.models import modelformset_factoryfrom django.http import (HttpResponseForbidden,@@ -32,6 +28,10 @@ from django.http import ()from django.shortcuts import get_object_or_404from django.template.context_processors import csrf+from django.urls import (+ reverse,+ reverse_lazy+)from django.utils.translation import (ugettext as _,ugettext_lazy@@ -49,7 +49,6 @@ from wger.manager.forms import (WorkoutLogForm)from wger.manager.helpers import WorkoutCalendar-from wger.utils.helpers import ua_aware_renderfrom wger.manager.models import (Day,Schedule,@@ -61,7 +60,10 @@ from wger.utils.generic_views import (WgerDeleteMixin,WgerFormMixin)-from wger.utils.helpers import check_access+from wger.utils.helpers import (+ check_access,+ ua_aware_render+)from wger.weight.helpers import (group_log_entries,process_log_entriesdiff --git a/wger/manager/views/pdf.py b/wger/manager/views/pdf.pyindex 6e8504ec2..5a5a6f828 100644--- a/wger/manager/views/pdf.py+++ b/wger/manager/views/pdf.py@@ -17,15 +17,17 @@# Standard Libraryimport logging-# Third Party+# Djangofrom django.http import (HttpResponse,HttpResponseForbidden)from django.shortcuts import get_object_or_404from django.utils.translation import ugettext as _-from reportlab.lib.units import cm++# Third Partyfrom reportlab.lib.pagesizes import A4+from reportlab.lib.units import cmfrom reportlab.platypus import (Paragraph,SimpleDocTemplate,diff --git a/wger/manager/views/schedule.py b/wger/manager/views/schedule.pyindex b2f12aaa9..82394ed29 100644--- a/wger/manager/views/schedule.py+++ b/wger/manager/views/schedule.py@@ -18,28 +18,31 @@import datetimeimport logging-# Third Party+# Djangofrom django.contrib.auth.decorators import login_requiredfrom django.contrib.auth.mixins import PermissionRequiredMixin-from django.urls import (- reverse,- reverse_lazy-)from django.http import (HttpResponse,HttpResponseForbidden,HttpResponseRedirect)from django.shortcuts import get_object_or_404+from django.urls import (+ reverse,+ reverse_lazy+)from django.utils.translation import (ugettext as _,ugettext_lazy)+from django.views.decorators.vary import vary_on_headersfrom django.views.generic import (CreateView,DeleteView,UpdateView)++# Third Partyfrom reportlab.lib.pagesizes import A4from reportlab.lib.units import cmfrom reportlab.platypus import (@@ -47,7 +50,6 @@ from reportlab.platypus import (SimpleDocTemplate,Spacer)-from django.views.decorators.vary import vary_on_headers# wgerfrom wger.manager.helpers import render_workout_daydiff --git a/wger/manager/views/schedule_step.py b/wger/manager/views/schedule_step.pyindex 926b926fc..9aacb709c 100644--- a/wger/manager/views/schedule_step.py+++ b/wger/manager/views/schedule_step.py@@ -17,14 +17,14 @@# Standard Libraryimport logging-# Third Party+# Djangofrom django.contrib.auth.mixins import PermissionRequiredMixin-from django.urls import reversefrom django.db import modelsfrom django.forms import (ModelChoiceField,ModelForm)+from django.urls import reversefrom django.utils.translation import (ugettext as _,ugettext_lazydiff --git a/wger/manager/views/set.py b/wger/manager/views/set.pyindex d0bcdc129..b4d3b0cd9 100644--- a/wger/manager/views/set.py+++ b/wger/manager/views/set.py@@ -17,10 +17,9 @@# Standard Libraryimport logging-# Third Party+# Djangofrom django.contrib.auth.decorators import login_requiredfrom django.core.exceptions import ObjectDoesNotExist-from django.urls import reversefrom django.db import modelsfrom django.forms.models import (inlineformset_factory,@@ -31,6 +30,9 @@ from django.http import (HttpResponseRedirect)from django.shortcuts import get_object_or_404+from django.urls import reverse++# Third Partyfrom django_user_agents.utils import get_user_agent# wger@@ -46,8 +48,8 @@ from wger.manager.models import (Set,Setting)-from wger.utils.language import load_item_languagesfrom wger.utils.helpers import ua_aware_render+from wger.utils.language import load_item_languageslogger = logging.getLogger(__name__)diff --git a/wger/manager/views/workout.py b/wger/manager/views/workout.pyindex ba06edc86..5e721e3f0 100644--- a/wger/manager/views/workout.py+++ b/wger/manager/views/workout.py@@ -19,28 +19,28 @@ import datetimeimport loggingimport uuid-# Third Party+# Djangofrom django.contrib.auth.decorators import login_requiredfrom django.contrib.auth.mixins import LoginRequiredMixin-from django.urls import (- reverse,- reverse_lazy-)from django.http import (HttpResponseForbidden,HttpResponseRedirect)from django.shortcuts import get_object_or_404from django.template.context_processors import csrf+from django.urls import (+ reverse,+ reverse_lazy+)from django.utils.translation import (ugettext as _,ugettext_lazy)+from django.views.decorators.vary import vary_on_headersfrom django.views.generic import (DeleteView,UpdateView)-from django.views.decorators.vary import vary_on_headers# wgerfrom wger.core.models import (diff --git a/wger/manager/views/workout_session.py b/wger/manager/views/workout_session.pyindex 544fcba0b..c7df24f95 100644--- a/wger/manager/views/workout_session.py+++ b/wger/manager/views/workout_session.py@@ -18,16 +18,16 @@import datetimeimport logging-# Third Party+# Djangofrom django.contrib.auth.mixins import LoginRequiredMixin-from django.urls import (- reverse,- reverse_lazy-)from django.http import (HttpResponseBadRequest,HttpResponseForbidden)+from django.urls import (+ reverse,+ reverse_lazy+)from django.utils.translation import (ugettext as _,ugettext_lazydiff --git a/wger/nutrition/__init__.py b/wger/nutrition/__init__.pyindex a915bb265..46a91e9bd 100644--- a/wger/nutrition/__init__.py+++ b/wger/nutrition/__init__.py@@ -16,6 +16,8 @@# along with Workout Manager. If not, see <http://www.gnu.org/licenses/>.+# wgerfrom wger import get_version+VERSION = get_version()diff --git a/wger/nutrition/forms.py b/wger/nutrition/forms.pyindex 36603b2de..3f9744395 100644--- a/wger/nutrition/forms.py+++ b/wger/nutrition/forms.py@@ -17,7 +17,7 @@# Standard Libraryimport logging-# Third Party+# Djangofrom django import formsfrom django.utils.translation import ugettext as _diff --git a/wger/nutrition/models.py b/wger/nutrition/models.pyindex bee7f3f6d..e00e800ab 100644--- a/wger/nutrition/models.py+++ b/wger/nutrition/models.py@@ -20,14 +20,13 @@ import logging#from decimal import Decimal-# Third Party+# Djangofrom django.conf import settingsfrom django.contrib.auth.models import Userfrom django.contrib.sites.models import Sitefrom django.core import mailfrom django.core.cache import cachefrom django.core.exceptions import ValidationError-from django.urls import reversefrom django.core.validators import (MaxValueValidator,MinValueValidator@@ -35,6 +34,7 @@ from django.core.validators import (from django.db import modelsfrom django.template.defaultfilters import slugify # django.utils.text.slugify in django 1.5!from django.template.loader import render_to_string+from django.urls import reversefrom django.utils import translationfrom django.utils.translation import ugettext_lazy as _diff --git a/wger/nutrition/sitemap.py b/wger/nutrition/sitemap.pyindex dd0337a6d..b75dbfaf1 100644--- a/wger/nutrition/sitemap.py+++ b/wger/nutrition/sitemap.py@@ -14,7 +14,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.contrib.sitemaps import Sitemap# wgerdiff --git a/wger/nutrition/tests/test_bmi.py b/wger/nutrition/tests/test_bmi.pyindex 96fbbd57d..5bef4e855 100644--- a/wger/nutrition/tests/test_bmi.py+++ b/wger/nutrition/tests/test_bmi.py@@ -17,7 +17,7 @@ import datetimeimport jsonfrom decimal import Decimal-# Third Party+# Djangofrom django.contrib.auth.models import Userfrom django.urls import reversediff --git a/wger/nutrition/tests/test_calories_calculator.py b/wger/nutrition/tests/test_calories_calculator.pyindex 01787401d..177bd9ab9 100644--- a/wger/nutrition/tests/test_calories_calculator.py+++ b/wger/nutrition/tests/test_calories_calculator.py@@ -17,7 +17,7 @@ import datetimeimport decimalimport json-# Third Party+# Djangofrom django.contrib.auth.models import Userfrom django.urls import reversediff --git a/wger/nutrition/tests/test_copy_plan.py b/wger/nutrition/tests/test_copy_plan.pyindex 84e8963d5..61526bb5b 100644--- a/wger/nutrition/tests/test_copy_plan.py+++ b/wger/nutrition/tests/test_copy_plan.py@@ -12,7 +12,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.urls import reverse# wgerdiff --git a/wger/nutrition/tests/test_ingredient.py b/wger/nutrition/tests/test_ingredient.pyindex 95a8cf315..d8533ab96 100644--- a/wger/nutrition/tests/test_ingredient.py+++ b/wger/nutrition/tests/test_ingredient.py@@ -18,7 +18,7 @@ import datetimeimport jsonfrom decimal import Decimal-# Third Party+# Djangofrom django.core.exceptions import ValidationErrorfrom django.urls import reversediff --git a/wger/nutrition/tests/test_ingredient_overview.py b/wger/nutrition/tests/test_ingredient_overview.pyindex a1b3f2e1a..3d8f50d25 100644--- a/wger/nutrition/tests/test_ingredient_overview.py+++ b/wger/nutrition/tests/test_ingredient_overview.py@@ -13,7 +13,7 @@# You should have received a copy of the GNU Affero General Public License# along with Workout Manager. If not, see <http://www.gnu.org/licenses/>.-# Third Party+# Djangofrom django.urls import reverse# wgerdiff --git a/wger/nutrition/tests/test_meal.py b/wger/nutrition/tests/test_meal.pyindex d42342011..b3e76a069 100644--- a/wger/nutrition/tests/test_meal.py+++ b/wger/nutrition/tests/test_meal.py@@ -16,7 +16,7 @@# Standard Libraryimport datetime-# Third Party+# Djangofrom django.urls import reverse# wgerdiff --git a/wger/nutrition/tests/test_meal_item.py b/wger/nutrition/tests/test_meal_item.pyindex 0581434d8..22591070d 100644--- a/wger/nutrition/tests/test_meal_item.py+++ b/wger/nutrition/tests/test_meal_item.py@@ -13,7 +13,7 @@# You should have received a copy of the GNU Affero General Public License# along with Workout Manager. If not, see <http://www.gnu.org/licenses/>.-# Third Party+# Djangofrom django.urls import reverse# wgerdiff --git a/wger/nutrition/tests/test_pdf.py b/wger/nutrition/tests/test_pdf.pyindex e6c4b80cd..7ba6b94b8 100644--- a/wger/nutrition/tests/test_pdf.py+++ b/wger/nutrition/tests/test_pdf.py@@ -12,7 +12,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.contrib.auth.models import Userfrom django.urls import reversediff --git a/wger/nutrition/tests/test_plan.py b/wger/nutrition/tests/test_plan.pyindex 3d0935a29..be8da225e 100644--- a/wger/nutrition/tests/test_plan.py+++ b/wger/nutrition/tests/test_plan.py@@ -13,7 +13,7 @@# You should have received a copy of the GNU Affero General Public License# along with Workout Manager. If not, see <http://www.gnu.org/licenses/>.-# Third Party+# Djangofrom django.urls import reverse# wgerdiff --git a/wger/nutrition/tests/test_submitted_ingredient.py b/wger/nutrition/tests/test_submitted_ingredient.pyindex 7019b98d8..602c02893 100644--- a/wger/nutrition/tests/test_submitted_ingredient.py+++ b/wger/nutrition/tests/test_submitted_ingredient.py@@ -12,7 +12,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.core import mailfrom django.urls import reversediff --git a/wger/nutrition/tests/test_weight_unit.py b/wger/nutrition/tests/test_weight_unit.pyindex 712c37ddd..73fea69be 100644--- a/wger/nutrition/tests/test_weight_unit.py+++ b/wger/nutrition/tests/test_weight_unit.py@@ -13,7 +13,7 @@# You should have received a copy of the GNU Affero General Public License# along with Workout Manager. If not, see <http://www.gnu.org/licenses/>.-# Third Party+# Djangofrom django.urls import reverse# wgerdiff --git a/wger/nutrition/tests/test_weight_unit_ingredient.py b/wger/nutrition/tests/test_weight_unit_ingredient.pyindex 7df30ec10..bd324000e 100644--- a/wger/nutrition/tests/test_weight_unit_ingredient.py+++ b/wger/nutrition/tests/test_weight_unit_ingredient.py@@ -13,7 +13,7 @@# You should have received a copy of the GNU Affero General Public License# along with Workout Manager. If not, see <http://www.gnu.org/licenses/>.-# Third Party+# Djangofrom django.urls import (reverse,reverse_lazydiff --git a/wger/nutrition/urls.py b/wger/nutrition/urls.pyindex 9357f56ff..9b1823c3a 100644--- a/wger/nutrition/urls.py+++ b/wger/nutrition/urls.py@@ -15,7 +15,7 @@# You should have received a copy of the GNU Affero General Public License# along with Workout Manager. If not, see <http://www.gnu.org/licenses/>.-# Third Party+# Djangofrom django.conf.urls import (include,urldiff --git a/wger/nutrition/views/bmi.py b/wger/nutrition/views/bmi.pyindex ca7d2afc2..df05dab20 100644--- a/wger/nutrition/views/bmi.py+++ b/wger/nutrition/views/bmi.py@@ -19,7 +19,7 @@import jsonimport logging-# Third Party+# Djangofrom django.contrib.auth.decorators import login_requiredfrom django.http import HttpResponsediff --git a/wger/nutrition/views/calculator.py b/wger/nutrition/views/calculator.pyindex 48f4b8e8d..9377eb018 100644--- a/wger/nutrition/views/calculator.py+++ b/wger/nutrition/views/calculator.py@@ -19,7 +19,7 @@import jsonimport logging-# Third Party+# Djangofrom django.contrib.auth.decorators import login_requiredfrom django.http import HttpResponsediff --git a/wger/nutrition/views/ingredient.py b/wger/nutrition/views/ingredient.pyindex b23f8369e..4e2d07f24 100644--- a/wger/nutrition/views/ingredient.py+++ b/wger/nutrition/views/ingredient.py@@ -17,7 +17,7 @@# Standard Libraryimport logging-# Third Party+# Djangofrom django.contrib import messagesfrom django.contrib.auth.decorators import permission_requiredfrom django.contrib.auth.mixins import (@@ -25,15 +25,15 @@ from django.contrib.auth.mixins import (PermissionRequiredMixin)from django.core.cache import cache-from django.urls import (- reverse,- reverse_lazy-)from django.http import (HttpResponseForbidden,HttpResponseRedirect)from django.shortcuts import get_object_or_404+from django.urls import (+ reverse,+ reverse_lazy+)from django.utils.translation import (ugettext as _,ugettext_lazy@@ -51,15 +51,15 @@ from wger.nutrition.models import Ingredientfrom wger.utils.cache import cache_mapperfrom wger.utils.constants import PAGINATION_OBJECTS_PER_PAGEfrom wger.utils.generic_views import (+ UAAwareViewMixin,WgerDeleteMixin,- WgerFormMixin,- UAAwareViewMixin+ WgerFormMixin)+from wger.utils.helpers import ua_aware_renderfrom wger.utils.language import (load_ingredient_languages,load_language)-from wger.utils.helpers import ua_aware_renderlogger = logging.getLogger(__name__)diff --git a/wger/nutrition/views/meal.py b/wger/nutrition/views/meal.pyindex 999f19fc3..0f3fe499c 100644--- a/wger/nutrition/views/meal.py+++ b/wger/nutrition/views/meal.py@@ -17,14 +17,14 @@# Standard Libraryimport logging-# Third Party+# Djangofrom django.contrib.auth.decorators import login_required-from django.urls import reversefrom django.http import (HttpResponseForbidden,HttpResponseRedirect)from django.shortcuts import get_object_or_404+from django.urls import reversefrom django.utils.translation import ugettext_lazyfrom django.views.generic import (CreateView,diff --git a/wger/nutrition/views/meal_item.py b/wger/nutrition/views/meal_item.pyindex b5e469777..4e2f2da80 100644--- a/wger/nutrition/views/meal_item.py+++ b/wger/nutrition/views/meal_item.py@@ -17,14 +17,14 @@# Standard Libraryimport logging-# Third Party+# Djangofrom django.contrib.auth.decorators import login_required-from django.urls import reversefrom django.http import (HttpResponseForbidden,HttpResponseRedirect)from django.shortcuts import get_object_or_404+from django.urls import reversefrom django.utils.translation import ugettext_lazyfrom django.views.generic import (CreateView,diff --git a/wger/nutrition/views/plan.py b/wger/nutrition/views/plan.pyindex 099608051..27f19888c 100644--- a/wger/nutrition/views/plan.py+++ b/wger/nutrition/views/plan.py@@ -18,12 +18,8 @@import datetimeimport logging-# Third Party+# Djangofrom django.contrib.auth.decorators import login_required-from django.urls import (- reverse,- reverse_lazy-)from django.http import (HttpResponse,HttpResponseForbidden,@@ -31,6 +27,10 @@ from django.http import ()from django.shortcuts import get_object_or_404from django.template.context_processors import csrf+from django.urls import (+ reverse,+ reverse_lazy+)from django.utils.translation import (ugettext as _,ugettext_lazy@@ -39,9 +39,11 @@ from django.views.generic import (DeleteView,UpdateView)++# Third Partyfrom reportlab.lib import colors-from reportlab.lib.units import cmfrom reportlab.lib.pagesizes import A4+from reportlab.lib.units import cmfrom reportlab.platypus import (Paragraph,SimpleDocTemplate,diff --git a/wger/nutrition/views/unit.py b/wger/nutrition/views/unit.pyindex 3ba28745a..dc5c93530 100644--- a/wger/nutrition/views/unit.py+++ b/wger/nutrition/views/unit.py@@ -17,7 +17,7 @@# Standard Libraryimport logging-# Third Party+# Djangofrom django.contrib.auth.mixins import (LoginRequiredMixin,PermissionRequiredMixin@@ -41,9 +41,9 @@ from django.views.generic import (from wger.nutrition.models import WeightUnitfrom wger.utils.constants import PAGINATION_OBJECTS_PER_PAGEfrom wger.utils.generic_views import (+ UAAwareViewMixin,WgerDeleteMixin,- WgerFormMixin,- UAAwareViewMixin+ WgerFormMixin)from wger.utils.language import load_languagediff --git a/wger/nutrition/views/unit_ingredient.py b/wger/nutrition/views/unit_ingredient.pyindex 97a586bda..801daa968 100644--- a/wger/nutrition/views/unit_ingredient.py+++ b/wger/nutrition/views/unit_ingredient.py@@ -17,17 +17,17 @@# Standard Libraryimport logging-# Third Party+# Djangofrom django.contrib.auth.mixins import (LoginRequiredMixin,PermissionRequiredMixin)-from django.urls import reversefrom django.forms import (ModelChoiceField,ModelForm)from django.shortcuts import get_object_or_404+from django.urls import reversefrom django.utils.translation import ugettext_lazyfrom django.views.generic import (CreateView,diff --git a/wger/settings.tpl b/wger/settings.tplindex 98c292918..b1b875615 100644--- a/wger/settings.tpl+++ b/wger/settings.tpl@@ -1,8 +1,10 @@#!/usr/bin/env python# -*- coding: utf-8 -*-+# wgerfrom wger.settings_global import *+# Use 'DEBUG = True' to get more details for server errorsDEBUG = TrueTEMPLATES[0]['OPTIONS']['debug'] = Truediff --git a/wger/software/__init__.py b/wger/software/__init__.pyindex a915bb265..46a91e9bd 100644--- a/wger/software/__init__.py+++ b/wger/software/__init__.py@@ -16,6 +16,8 @@# along with Workout Manager. If not, see <http://www.gnu.org/licenses/>.+# wgerfrom wger import get_version+VERSION = get_version()diff --git a/wger/software/urls.py b/wger/software/urls.pyindex a86b22854..b2511478a 100644--- a/wger/software/urls.py+++ b/wger/software/urls.py@@ -14,7 +14,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.conf.urls import urlfrom django.views.generic import (RedirectView,diff --git a/wger/software/views.py b/wger/software/views.pyindex d89365909..15c6c618f 100644--- a/wger/software/views.py+++ b/wger/software/views.py@@ -17,8 +17,10 @@# Standard Libraryimport logging-# Third Party+# Djangofrom django.conf import settings++# wgerfrom wger.utils.helpers import ua_aware_renderdiff --git a/wger/tasks.py b/wger/tasks.pyindex 7cbf457de..d38bcff3e 100644--- a/wger/tasks.py+++ b/wger/tasks.py@@ -24,13 +24,15 @@ import threading # noqa E402import time # noqa E402import webbrowser # noqa E402-# Third Party+# Djangoimport django # noqa E402from django.core.management import ( # noqa E402call_command,execute_from_command_line)from django.utils.crypto import get_random_string # noqa E402++# Third Partyfrom invoke import task # noqa E402diff --git a/wger/urls.py b/wger/urls.pyindex dfcb50f2f..34d1adf78 100644--- a/wger/urls.py+++ b/wger/urls.py@@ -15,7 +15,7 @@# You should have received a copy of the GNU Affero General Public License# along with Workout Manager. If not, see <http://www.gnu.org/licenses/>.-# Third Party+# Djangofrom django.conf import settingsfrom django.conf.urls import (include,@@ -25,6 +25,8 @@ from django.conf.urls.i18n import i18n_patternsfrom django.conf.urls.static import staticfrom django.contrib import adminfrom django.contrib.sitemaps.views import sitemap++# Third Partyfrom rest_framework import routersfrom tastypie.api import Apidiff --git a/wger/utils/__init__.py b/wger/utils/__init__.pyindex a915bb265..46a91e9bd 100644--- a/wger/utils/__init__.py+++ b/wger/utils/__init__.py@@ -16,6 +16,8 @@# along with Workout Manager. If not, see <http://www.gnu.org/licenses/>.+# wgerfrom wger import get_version+VERSION = get_version()diff --git a/wger/utils/cache.py b/wger/utils/cache.pyindex 01b272e27..13b926652 100644--- a/wger/utils/cache.py+++ b/wger/utils/cache.py@@ -16,7 +16,7 @@import hashlibimport logging-# Third Party+# Djangofrom django.core.cache import cachefrom django.utils.encoding import force_bytesdiff --git a/wger/utils/context_processor.py b/wger/utils/context_processor.pyindex 5d715a2b4..79e5ab56b 100644--- a/wger/utils/context_processor.py+++ b/wger/utils/context_processor.py@@ -13,7 +13,7 @@# You should have received a copy of the GNU Affero General Public License# along with Workout Manager. If not, see <http://www.gnu.org/licenses/>.-# Third Party+# Djangofrom django.conf import settingsfrom django.templatetags.static import staticdiff --git a/wger/utils/fields.py b/wger/utils/fields.pyindex 7f6bbb71d..0a90ebdc0 100644--- a/wger/utils/fields.py+++ b/wger/utils/fields.py@@ -15,7 +15,7 @@# Standard Libraryimport logging-# Third Party+# Djangofrom django.db import models# wgerdiff --git a/wger/utils/generic_views.py b/wger/utils/generic_views.pyindex 73a9e2403..13eef4995 100644--- a/wger/utils/generic_views.py+++ b/wger/utils/generic_views.py@@ -17,24 +17,27 @@# Standard Libraryimport logging-# Third Party-import bleach+# Djangofrom django.contrib import messagesfrom django.contrib.auth.mixins import PermissionRequiredMixin-from django.urls import (- reverse,- reverse_lazy-)from django.http import (HttpResponseForbidden,HttpResponseRedirect)from django.template.context_processors import csrf+from django.urls import (+ reverse,+ reverse_lazy+)from django.utils.translation import ugettext_lazyfrom django.views.generic import TemplateViewfrom django.views.generic.base import Viewfrom django.views.generic.edit import ModelFormMixin+# Third Party+import bleach+from django_user_agents.utils import get_user_agent+# wgerfrom wger.utils.constants import (HTML_ATTRIBUTES_WHITELIST,@@ -42,7 +45,6 @@ from wger.utils.constants import (HTML_TAG_WHITELIST)-from django_user_agents.utils import get_user_agentlogger = logging.getLogger(__name__)diff --git a/wger/utils/helpers.py b/wger/utils/helpers.pyindex 2be09eb17..fdfc3e497 100644--- a/wger/utils/helpers.py+++ b/wger/utils/helpers.py@@ -24,20 +24,24 @@ import randomimport stringfrom functools import wraps-# Third Party+# Djangofrom django.contrib.auth.models import Userfrom django.contrib.auth.tokens import default_token_generatorfrom django.http import Http404-from django.shortcuts import get_object_or_404+from django.shortcuts import (+ get_object_or_404,+ render+)+from django.template.exceptions import TemplateDoesNotExistfrom django.utils.encoding import force_bytesfrom django.utils.http import (urlsafe_base64_decode,urlsafe_base64_encode)-from django.shortcuts import render+# Third Partyfrom django_user_agents.utils import get_user_agent-from django.template.exceptions import TemplateDoesNotExist+logger = logging.getLogger(__name__)diff --git a/wger/utils/language.py b/wger/utils/language.pyindex 847a2ad80..ccb790915 100644--- a/wger/utils/language.py+++ b/wger/utils/language.py@@ -15,7 +15,7 @@# Standard Libraryimport logging-# Third Party+# Djangofrom django.core.cache import cachefrom django.core.exceptions import ObjectDoesNotExistfrom django.utils import translationdiff --git a/wger/utils/managers.py b/wger/utils/managers.pyindex 2f7fd62e2..77458f1c6 100644--- a/wger/utils/managers.py+++ b/wger/utils/managers.py@@ -13,7 +13,7 @@# You should have received a copy of the GNU Affero General Public License# along with Workout Manager. If not, see <http://www.gnu.org/licenses/>.-# Third Party+# Djangofrom django.db import modelsfrom django.db.models.query import QuerySetdiff --git a/wger/utils/middleware.py b/wger/utils/middleware.pyindex 90993a2e1..6afb73c59 100644--- a/wger/utils/middleware.py+++ b/wger/utils/middleware.py@@ -19,12 +19,12 @@ Custom middleware# Standard Libraryimport logging-# Third Party+# Djangofrom django.conf import settingsfrom django.contrib import authfrom django.contrib.auth import login as django_login-from django.utils.functional import SimpleLazyObjectfrom django.utils.deprecation import MiddlewareMixin+from django.utils.functional import SimpleLazyObject# wgerfrom wger.core.demo import create_temporary_userdiff --git a/wger/utils/models.py b/wger/utils/models.pyindex 5ee61da06..61fa1c2d1 100644--- a/wger/utils/models.py+++ b/wger/utils/models.py@@ -14,7 +14,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.db import modelsfrom django.utils.translation import ugettext_lazy as _diff --git a/wger/utils/pdf.py b/wger/utils/pdf.pyindex 3fcdfa225..39a3c28c3 100644--- a/wger/utils/pdf.py+++ b/wger/utils/pdf.py@@ -16,10 +16,12 @@import datetimefrom os.path import join as path_join-# Third Party+# Djangofrom django.conf import settingsfrom django.core.exceptions import ObjectDoesNotExistfrom django.utils import translation++# Third Partyfrom reportlab.lib.styles import (ParagraphStyle,StyleSheet1diff --git a/wger/utils/tests/test_check_access.py b/wger/utils/tests/test_check_access.pyindex 7dd10bcf6..77c9bec1e 100644--- a/wger/utils/tests/test_check_access.py+++ b/wger/utils/tests/test_check_access.py@@ -12,7 +12,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.contrib.auth.models import (AnonymousUser,Userdiff --git a/wger/utils/tests/test_middleware.py b/wger/utils/tests/test_middleware.pyindex ab95f09b9..73c704f91 100644--- a/wger/utils/tests/test_middleware.py+++ b/wger/utils/tests/test_middleware.py@@ -12,7 +12,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.urls import reverse# wgerdiff --git a/wger/utils/widgets.py b/wger/utils/widgets.pyindex e562dc3ae..1f0064ed4 100644--- a/wger/utils/widgets.py+++ b/wger/utils/widgets.py@@ -20,7 +20,7 @@ import loggingimport uuidfrom itertools import chain-# Third Party+# Djangofrom django.forms import fieldsfrom django.forms.widgets import (CheckboxInput,diff --git a/wger/weight/__init__.py b/wger/weight/__init__.pyindex a915bb265..46a91e9bd 100644--- a/wger/weight/__init__.py+++ b/wger/weight/__init__.py@@ -16,6 +16,8 @@# along with Workout Manager. If not, see <http://www.gnu.org/licenses/>.+# wgerfrom wger import get_version+VERSION = get_version()diff --git a/wger/weight/admin.py b/wger/weight/admin.pyindex 7f05ee077..fb62051e4 100644--- a/wger/weight/admin.py+++ b/wger/weight/admin.py@@ -12,7 +12,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django.contrib import admin# wgerdiff --git a/wger/weight/forms.py b/wger/weight/forms.pyindex b3654f6dc..110ab7e15 100644--- a/wger/weight/forms.py+++ b/wger/weight/forms.py@@ -14,7 +14,7 @@## You should have received a copy of the GNU Affero General Public License-# Third Party+# Djangofrom django import formsfrom django.forms import (CharField,diff --git a/wger/weight/helpers.py b/wger/weight/helpers.pyindex 100a8b1b6..81d99817d 100644--- a/wger/weight/helpers.py+++ b/wger/weight/helpers.py@@ -18,12 +18,12 @@import csvimport datetimeimport decimal+import ioimport jsonimport logging-import iofrom collections import OrderedDict-# Third Party+# Djangofrom django.core.cache import cache# wgerdiff --git a/wger/weight/management/commands/email-weight-reminder.py b/wger/weight/management/commands/email-weight-reminder.pyindex 19f605edb..8877d5046 100644--- a/wger/weight/management/commands/email-weight-reminder.py+++ b/wger/weight/management/commands/email-weight-reminder.py@@ -17,7 +17,7 @@# Standard Libraryimport datetime-# Third Party+# Djangofrom django.conf import settingsfrom django.contrib.sites.models import Sitefrom django.core import maildiff --git a/wger/weight/models.py b/wger/weight/models.pyindex 79a2bfc27..c35c10339 100644--- a/wger/weight/models.py+++ b/wger/weight/models.py@@ -15,7 +15,7 @@# You should have received a copy of the GNU Affero General Public License# along with Workout Manager. If not, see <http://www.gnu.org/licenses/>.-# Third Party+# Djangofrom django.contrib.auth.models import Userfrom django.core.validators import (MaxValueValidator,diff --git a/wger/weight/tests/test_csv_export.py b/wger/weight/tests/test_csv_export.pyindex d4829d2c9..459aaf93b 100644--- a/wger/weight/tests/test_csv_export.py+++ b/wger/weight/tests/test_csv_export.py@@ -15,7 +15,7 @@# Standard Libraryimport logging-# Third Party+# Djangofrom django.urls import reverse# wgerdiff --git a/wger/weight/tests/test_csv_import.py b/wger/weight/tests/test_csv_import.pyindex 12d68a871..bc74e919a 100644--- a/wger/weight/tests/test_csv_import.py+++ b/wger/weight/tests/test_csv_import.py@@ -15,7 +15,7 @@# Standard Libraryimport logging-# Third Party+# Djangofrom django.urls import reverse# wgerdiff --git a/wger/weight/tests/test_email_weight_reminder.py b/wger/weight/tests/test_email_weight_reminder.pyindex 18b58ec76..ba35ee735 100644--- a/wger/weight/tests/test_email_weight_reminder.py+++ b/wger/weight/tests/test_email_weight_reminder.py@@ -18,7 +18,7 @@ from datetime import (timedelta)-# Third Party+# Djangofrom django.contrib.auth.models import Userfrom django.core import mailfrom django.core.management import call_commanddiff --git a/wger/weight/tests/test_entry.py b/wger/weight/tests/test_entry.pyindex 22ac298d0..76a58a315 100644--- a/wger/weight/tests/test_entry.py+++ b/wger/weight/tests/test_entry.py@@ -16,7 +16,7 @@import datetimeimport decimal-# Third Party+# Djangofrom django.urls import reverse# wgerdiff --git a/wger/weight/tests/test_overview.py b/wger/weight/tests/test_overview.pyindex e8f6643b8..abb70fdc6 100644--- a/wger/weight/tests/test_overview.py+++ b/wger/weight/tests/test_overview.py@@ -15,7 +15,7 @@# Standard Libraryimport logging-# Third Party+# Djangofrom django.urls import reverse# wgerdiff --git a/wger/weight/urls.py b/wger/weight/urls.pyindex 3de3bfee0..a6a288b92 100644--- a/wger/weight/urls.py+++ b/wger/weight/urls.py@@ -15,7 +15,7 @@# You should have received a copy of the GNU Affero General Public License# along with Workout Manager. If not, see <http://www.gnu.org/licenses/>.-# Third Party+# Djangofrom django.conf.urls import urlfrom django.contrib.auth.decorators import login_requireddiff --git a/wger/weight/views.py b/wger/weight/views.pyindex 0b5e64011..4e5612c6e 100644--- a/wger/weight/views.py+++ b/wger/weight/views.py@@ -19,12 +19,8 @@ import csvimport datetimeimport logging-# Third Party+# Djangofrom django.contrib.auth.decorators import login_required-from django.urls import (- reverse,- reverse_lazy-)from django.db.models import (Max,Min@@ -33,6 +29,10 @@ from django.http import (HttpResponse,HttpResponseRedirect)+from django.urls import (+ reverse,+ reverse_lazy+)from django.utils.translation import (ugettext as _,ugettext_lazy@@ -41,6 +41,8 @@ from django.views.generic import (CreateView,UpdateView)++# Third Partyfrom formtools.preview import FormPreviewfrom rest_framework.decorators import api_viewfrom rest_framework.response import Responsediff --git a/wger/wsgi.py b/wger/wsgi.pyindex 1ec31d3d8..295ed61c1 100644--- a/wger/wsgi.py+++ b/wger/wsgi.py@@ -16,7 +16,7 @@ framework.# Standard Libraryimport os-# Third Party+# Djangofrom django.core.wsgi import get_wsgi_application