Self hosted FLOSS fitness/workout, nutrition and weight tracker
Remove unused functions
Roland Geiderf13d4ee9e0b7
diff --git a/wger/manager/tests/test_pdf.py b/wger/manager/tests/test_pdf.pyindex 1a8e274fa..b297ea4c1 100644--- a/wger/manager/tests/test_pdf.py+++ b/wger/manager/tests/test_pdf.py@@ -18,7 +18,6 @@ from django.urls import reverse# wgerfrom wger.core.tests.base_testcase import WgerTestCase-from wger.utils.helpers import make_tokenclass RoutinePdfLogExportTestCase(WgerTestCase):diff --git a/wger/nutrition/tests/test_pdf.py b/wger/nutrition/tests/test_pdf.pyindex 4634db324..60a958179 100644--- a/wger/nutrition/tests/test_pdf.py+++ b/wger/nutrition/tests/test_pdf.py@@ -20,7 +20,6 @@ from django.urls import reversefrom wger.core.models import Languagefrom wger.core.tests.base_testcase import WgerTestCasefrom wger.nutrition.models import NutritionPlan-from wger.utils.helpers import make_tokenclass NutritionalPlanPdfExportTestCase(WgerTestCase):diff --git a/wger/nutrition/views/plan.py b/wger/nutrition/views/plan.pyindex cbdb7d30a..785ba2fe7 100644--- a/wger/nutrition/views/plan.py+++ b/wger/nutrition/views/plan.py@@ -42,7 +42,6 @@ from reportlab.platypus import (# wgerfrom wger.nutrition.consts import MEALITEM_WEIGHT_GRAMfrom wger.nutrition.models import NutritionPlan-from wger.utils.helpers import check_tokenfrom wger.utils.pdf import (get_logo,header_colour,@@ -51,7 +50,6 @@ from wger.utils.pdf import (styleSheet,)-logger = logging.getLogger(__name__)diff --git a/wger/utils/helpers.py b/wger/utils/helpers.pyindex b3f4169e7..a3f6cb701 100644--- a/wger/utils/helpers.py+++ b/wger/utils/helpers.py@@ -38,7 +38,6 @@ from django.utils.http import (urlsafe_base64_encode,)-logger = logging.getLogger(__name__)@@ -92,26 +91,6 @@ def disable_for_loaddata(signal_handler):return wrapper-def next_weekday(date, weekday):- """- Helper function to find the next weekday after a given date,- e.g. the first Monday after the 2013-12-05-- See link for more details:- * http://stackoverflow.com/questions/6558535/python-find-the-date-for-the-first-monday-after-a-- :param date: the start date- :param weekday: weekday (0, Monday, 1 Tuesday, 2 Wednesday)- :type date: datetime.date- :type weekday int- :return: datetime.date- """- days_ahead = weekday - date.weekday()- if days_ahead <= 0:- days_ahead += 7- return date + datetime.timedelta(days_ahead)--def make_uid(input):"""Small wrapper to generate a UID, usually used in URLs to allow for@@ -120,45 +99,6 @@ def make_uid(input):return urlsafe_base64_encode(force_bytes(input))-def make_token(user):- """- Convenience function that generates the UID and token for a user-- :param user: a user object- :return: the uid and the token- """- uid = make_uid(user.pk)- token = default_token_generator.make_token(user)-- return uid, token---def check_token(uidb64, token):- """- Checks that the user token is correct.-- :param uidb:- :param token:- :return: True on success, False in all other situations- """- if uidb64 is not None and token is not None:- try:- uid = int(urlsafe_base64_decode(uidb64))- except ValueError as e:- logger.info(f'Could not decode UID: {e}')- return False-- try:- user = User.objects.get(pk=uid)- if user is not None and default_token_generator.check_token(user, token):- return True-- except User.DoesNotExist:- return False-- return False--def password_generator(length=15):"""A simple password generator