Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Remove unused imports and other fixes

Roland Geideraf834cfe56df
diff --git a/wger/core/api/views.py b/wger/core/api/views.py
index 2abe8cdc7..b5d1d6702 100644
--- a/wger/core/api/views.py
+++ b/wger/core/api/views.py
@@ -53,7 +53,6 @@ from wger import (
MIN_APP_VERSION,
get_version,
)
-from wger.core.api.permissions import AllowRegisterUser
from wger.core.api.serializers import (
DaysOfWeekSerializer,
LanguageSerializer,
diff --git a/wger/core/management/commands/clear-cache.py b/wger/core/management/commands/clear-cache.py
index 99b916144..6db46d13a 100644
--- a/wger/core/management/commands/clear-cache.py
+++ b/wger/core/management/commands/clear-cache.py
@@ -21,10 +21,7 @@ from django.core.management.base import (
)
# wger
-from wger.manager.models import (
- Workout,
- WorkoutLog,
-)
+from wger.manager.models import WorkoutLog
from wger.utils.cache import reset_workout_log
diff --git a/wger/core/management/commands/dummy-generator-users.py b/wger/core/management/commands/dummy-generator-users.py
index 19ffccc89..912fafe5c 100644
--- a/wger/core/management/commands/dummy-generator-users.py
+++ b/wger/core/management/commands/dummy-generator-users.py
@@ -92,7 +92,7 @@ class Command(BaseCommand):
# Even with the uuid part, usernames are not guaranteed to be unique,
# in this case, just ignore and continue
- except IntegrityError as e:
+ except IntegrityError:
continue
if gym_list:
diff --git a/wger/core/management/commands/extract-i18n-flutter-exercises.py b/wger/core/management/commands/extract-i18n-flutter-exercises.py
index 49ddc9ee3..dda770932 100644
--- a/wger/core/management/commands/extract-i18n-flutter-exercises.py
+++ b/wger/core/management/commands/extract-i18n-flutter-exercises.py
@@ -92,4 +92,4 @@ class Command(BaseCommand):
# Write to output
with open('screenshots_exercises.dart', 'w') as f:
f.write('\n'.join(out))
- self.stdout.write(self.style.SUCCESS(f'Wrote content to screenshots_exercises.dart'))
+ self.stdout.write(self.style.SUCCESS('Wrote content to screenshots_exercises.dart'))
diff --git a/wger/core/management/commands/extract-i18n.py b/wger/core/management/commands/extract-i18n.py
index 70f538ef3..055ee9aae 100644
--- a/wger/core/management/commands/extract-i18n.py
+++ b/wger/core/management/commands/extract-i18n.py
@@ -68,7 +68,7 @@ class Command(BaseCommand):
for i in data:
out += f'{{% translate "{i}" %}}\n'
f.write(out)
- self.stdout.write(self.style.SUCCESS(f'Wrote content to wger/i18n.tpl'))
+ self.stdout.write(self.style.SUCCESS('Wrote content to wger/i18n.tpl'))
#
# React - copy the file to src/i18n.tsx in the React repo
@@ -93,7 +93,7 @@ class Command(BaseCommand):
return (<p></p>);
};"""
f.write(out)
- self.stdout.write(self.style.SUCCESS(f'Wrote content to wger/i18n.tsx'))
+ self.stdout.write(self.style.SUCCESS('Wrote content to wger/i18n.tsx'))
#
# Flutter - copy content to the end of lib/l10n/app_en.arb in the flutter repo
@@ -102,10 +102,10 @@ class Command(BaseCommand):
for i in data:
out += f'"{cleanup_name(i.__str__())}": "{i}",\n'
out += f'"@{cleanup_name(i.__str__())}": {{ \n'
- out += f'"description": "Generated entry for translation for server strings"\n'
+ out += '"description": "Generated entry for translation for server strings"\n'
out += '},\n'
f.write(out)
- self.stdout.write(self.style.SUCCESS(f'Wrote content to app_en.arb'))
+ self.stdout.write(self.style.SUCCESS('Wrote content to app_en.arb'))
# Copy to lib/helpers/i18n.dart in the flutter repo
with open('wger/i18n.dart', 'w') as f:
diff --git a/wger/core/migrations/0006_auto_20151025_2237.py b/wger/core/migrations/0006_auto_20151025_2237.py
index f1989f8d5..6d682f7fc 100644
--- a/wger/core/migrations/0006_auto_20151025_2237.py
+++ b/wger/core/migrations/0006_auto_20151025_2237.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-from django.db import migrations, models
+from django.db import migrations
def create_usercache(apps, schema_editor):
diff --git a/wger/core/migrations/0009_auto_20160303_2340.py b/wger/core/migrations/0009_auto_20160303_2340.py
index 081c07d67..20f2e7c58 100644
--- a/wger/core/migrations/0009_auto_20160303_2340.py
+++ b/wger/core/migrations/0009_auto_20160303_2340.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-from django.db import migrations, models
+from django.db import migrations
def insert_data(apps, schema_editor):
diff --git a/wger/core/templatetags/wger_extras.py b/wger/core/templatetags/wger_extras.py
index c9c0e563d..500476a28 100644
--- a/wger/core/templatetags/wger_extras.py
+++ b/wger/core/templatetags/wger_extras.py
@@ -28,7 +28,6 @@ from django.utils.translation import (
# wger
from wger.core.tests.base_testcase import get_reverse
-from wger.manager.models import Day
from wger.utils.constants import (
PAGINATION_MAX_TOTAL_PAGES,
PAGINATION_PAGES_AROUND_CURRENT,
diff --git a/wger/core/tests/test_generator.py b/wger/core/tests/test_generator.py
index efa497236..a8cb7e84c 100644
--- a/wger/core/tests/test_generator.py
+++ b/wger/core/tests/test_generator.py
@@ -18,7 +18,6 @@ from django.core.management import call_command
# wger
from wger.core.tests.base_testcase import WgerTestCase
-from wger.gym.models import Gym
class UserGeneratorTestCase(WgerTestCase):
diff --git a/wger/core/tests/test_user.py b/wger/core/tests/test_user.py
index 059fe05c9..d0e061bc9 100644
--- a/wger/core/tests/test_user.py
+++ b/wger/core/tests/test_user.py
@@ -13,7 +13,6 @@
# You should have received a copy of the GNU Affero General Public License
# Standard Library
import datetime
-from unittest import TestCase
# Django
from django.contrib.auth.models import User
diff --git a/wger/core/tests/test_user_rest_registration.py b/wger/core/tests/test_user_rest_registration.py
index 28353c54b..fefdd5f63 100644
--- a/wger/core/tests/test_user_rest_registration.py
+++ b/wger/core/tests/test_user_rest_registration.py
@@ -11,7 +11,6 @@ from rest_framework.authtoken.models import Token
from rest_framework.status import (
HTTP_201_CREATED,
HTTP_400_BAD_REQUEST,
- HTTP_403_FORBIDDEN,
)
# wger
diff --git a/wger/exercises/management/commands/change-exercise-author.py b/wger/exercises/management/commands/change-exercise-author.py
index c55e65eb4..e5670b8ad 100644
--- a/wger/exercises/management/commands/change-exercise-author.py
+++ b/wger/exercises/management/commands/change-exercise-author.py
@@ -82,7 +82,7 @@ class Command(BaseCommand):
exercise.license_author = author_name
exercise.save()
- self.stdout.write(self.style.SUCCESS(f'Exercise and/or translation has been updated'))
+ self.stdout.write(self.style.SUCCESS('Exercise and/or translation has been updated'))
def print_error(self, error_message):
self.stdout.write(self.style.WARNING(f'{error_message}'))
diff --git a/wger/exercises/management/commands/read-exercise-cleanup.py b/wger/exercises/management/commands/read-exercise-cleanup.py
index 697ad5f87..770b1e874 100644
--- a/wger/exercises/management/commands/read-exercise-cleanup.py
+++ b/wger/exercises/management/commands/read-exercise-cleanup.py
@@ -117,7 +117,7 @@ class Command(BaseCommand):
#
new_base = base_uuid == UUID_NEW
if not options['create_on_new'] and new_base:
- self.stdout.write(f' Skipping creating new exercise base...\n')
+ self.stdout.write(' Skipping creating new exercise base...\n')
continue
base = (
@@ -237,7 +237,7 @@ class Command(BaseCommand):
self.stdout.write(self.style.SUCCESS(message))
if '(imported from Feeel)' in exercise_author:
- exercise_author = re.sub('\(imported from Feeel\)', '', exercise_author)
+ exercise_author = re.sub(r'\(imported from Feeel\)', '', exercise_author)
for author in exercise_author.split(','):
author = author.strip()
author = f'{author} (imported from Feeel)'
@@ -245,7 +245,7 @@ class Command(BaseCommand):
if len(author) >= 60:
self.stdout.write(
self.style.WARNING(
- f' Author name is longer than 60 characters, skipping...'
+ ' Author name is longer than 60 characters, skipping...'
)
)
continue
@@ -264,7 +264,7 @@ class Command(BaseCommand):
csv_file = open('exercises_cleanup_duplicates.csv', 'r', newline='')
file_reader = csv.DictReader(csv_file)
self.stdout.write(
- self.style.WARNING(f'---> Deleting duplicate bases and translations now...')
+ self.style.WARNING('---> Deleting duplicate bases and translations now...')
)
for row in file_reader:
diff --git a/wger/exercises/migrations/0029_full_text_search.py b/wger/exercises/migrations/0029_full_text_search.py
index 7a4a1e52f..50ad1d17b 100644
--- a/wger/exercises/migrations/0029_full_text_search.py
+++ b/wger/exercises/migrations/0029_full_text_search.py
@@ -2,7 +2,7 @@
import django.contrib.postgres.search
from django.contrib.postgres.operations import TrigramExtension, BtreeGinExtension
-from django.db import migrations, models
+from django.db import migrations
class Migration(migrations.Migration):
diff --git a/wger/exercises/models/video.py b/wger/exercises/models/video.py
index 07ba6e8b2..024b75dbd 100644
--- a/wger/exercises/models/video.py
+++ b/wger/exercises/models/video.py
@@ -68,7 +68,7 @@ def validate_video(value):
try:
ffmpeg.probe(value.file.temporary_file_path())
- except ffmpeg.Error as e:
+ except ffmpeg.Error:
raise ValidationError(_('File is not a valid video'))
diff --git a/wger/gym/migrations/0002_auto_20151003_1944.py b/wger/gym/migrations/0002_auto_20151003_1944.py
index ff20c20b0..fc9121d29 100644
--- a/wger/gym/migrations/0002_auto_20151003_1944.py
+++ b/wger/gym/migrations/0002_auto_20151003_1944.py
@@ -2,7 +2,6 @@
from django.db import models, migrations
from django.conf import settings
-import datetime
class Migration(migrations.Migration):
diff --git a/wger/gym/migrations/0006_auto_20160214_1013.py b/wger/gym/migrations/0006_auto_20160214_1013.py
index 6c07037ad..55440f1d4 100644
--- a/wger/gym/migrations/0006_auto_20160214_1013.py
+++ b/wger/gym/migrations/0006_auto_20160214_1013.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-from django.db import migrations, models
+from django.db import migrations
def update_permission_names(apps, schema_editor):
diff --git a/wger/manager/api/serializers.py b/wger/manager/api/serializers.py
index 13a87c203..780e23c92 100644
--- a/wger/manager/api/serializers.py
+++ b/wger/manager/api/serializers.py
@@ -18,10 +18,7 @@
from rest_framework import serializers
# wger
-from wger.manager.api.consts import (
- BASE_CONFIG_FIELDS,
- BASE_CONFIG_FILTER_FIELDS,
-)
+from wger.manager.api.consts import BASE_CONFIG_FIELDS
from wger.manager.api.validators import validate_requirements
from wger.manager.models import (
Day,
diff --git a/wger/manager/config_calculations/calculations.py b/wger/manager/config_calculations/calculations.py
index 1417eafb8..006706019 100644
--- a/wger/manager/config_calculations/calculations.py
+++ b/wger/manager/config_calculations/calculations.py
@@ -19,7 +19,6 @@ from abc import (
ABC,
abstractmethod,
)
-from decimal import Decimal
# wger
from wger.manager.dataclasses import SetConfigData
diff --git a/wger/manager/dataclasses.py b/wger/manager/dataclasses.py
index e1a0b48d6..fe01ce562 100644
--- a/wger/manager/dataclasses.py
+++ b/wger/manager/dataclasses.py
@@ -39,7 +39,6 @@ from wger.core.models import (
RepetitionUnit,
WeightUnit,
)
-from wger.utils.helpers import normalize_decimal
@dataclass
diff --git a/wger/manager/migrations/0002_auto_20150202_2040.py b/wger/manager/migrations/0002_auto_20150202_2040.py
index df9258b47..4e76e3065 100644
--- a/wger/manager/migrations/0002_auto_20150202_2040.py
+++ b/wger/manager/migrations/0002_auto_20150202_2040.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-from django.db import models, migrations
+from django.db import migrations
from sortedm2m.operations import AlterSortedManyToManyField
import sortedm2m.fields
diff --git a/wger/manager/migrations/0007_auto_20160311_2258.py b/wger/manager/migrations/0007_auto_20160311_2258.py
index 354aa836d..ed52e50ae 100644
--- a/wger/manager/migrations/0007_auto_20160311_2258.py
+++ b/wger/manager/migrations/0007_auto_20160311_2258.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-from django.db import migrations, models
+from django.db import migrations
def convert_logs(apps, schema_editor):
diff --git a/wger/manager/models/day.py b/wger/manager/models/day.py
index e89988c64..d5dc3ba7e 100644
--- a/wger/manager/models/day.py
+++ b/wger/manager/models/day.py
@@ -23,7 +23,6 @@ from django.db import models
from django.utils.translation import gettext_lazy as _
# wger
-from wger.core.models import DaysOfWeek
from wger.manager.dataclasses import SlotData
diff --git a/wger/manager/models/rir_config.py b/wger/manager/models/rir_config.py
index 16d16bd82..b8882b346 100644
--- a/wger/manager/models/rir_config.py
+++ b/wger/manager/models/rir_config.py
@@ -18,7 +18,6 @@
from django.db import models
# wger
-from wger.manager.consts import RIR_OPTIONS
from wger.manager.models import AbstractChangeConfig
diff --git a/wger/manager/models/workout.py b/wger/manager/models/workout.py
index 8626b85bb..0a0718932 100644
--- a/wger/manager/models/workout.py
+++ b/wger/manager/models/workout.py
@@ -16,7 +16,6 @@
# Django
from django.contrib.auth.models import User
-from django.core.cache import cache
from django.core.exceptions import ValidationError
from django.db import models
from django.urls import reverse
diff --git a/wger/manager/tests/test_pdf.py b/wger/manager/tests/test_pdf.py
index b297ea4c1..534d8b2b7 100644
--- a/wger/manager/tests/test_pdf.py
+++ b/wger/manager/tests/test_pdf.py
@@ -13,7 +13,6 @@
# You should have received a copy of the GNU Affero General Public License
# Django
-from django.contrib.auth.models import User
from django.urls import reverse
# wger
diff --git a/wger/manager/tests/test_slot.py b/wger/manager/tests/test_slot.py
index 359acafd8..9512710e9 100644
--- a/wger/manager/tests/test_slot.py
+++ b/wger/manager/tests/test_slot.py
@@ -12,8 +12,6 @@
#
# You should have received a copy of the GNU Affero General Public License
-# Standard Library
-from decimal import Decimal
# wger
from wger.core.tests.base_testcase import WgerTestCase
diff --git a/wger/manager/urls.py b/wger/manager/urls.py
index 3bf45a3ae..48581d5c1 100644
--- a/wger/manager/urls.py
+++ b/wger/manager/urls.py
@@ -28,6 +28,7 @@ from wger.manager.views import (
workout,
)
+
# sub patterns for workout logs
patterns_log = [
path(
@@ -77,7 +78,6 @@ patterns_workout = [
workout.WorkoutMarkAsTemplateView.as_view(),
name='make-template',
),
-
]
# sub patterns for workouts
diff --git a/wger/manager/views/ical.py b/wger/manager/views/ical.py
index b610172c3..baa9e925a 100644
--- a/wger/manager/views/ical.py
+++ b/wger/manager/views/ical.py
@@ -15,7 +15,6 @@
# You should have received a copy of the GNU Affero General Public License
# Standard Library
-import datetime
import logging
# Django
diff --git a/wger/manager/views/workout.py b/wger/manager/views/workout.py
index 393168495..745c8bd65 100644
--- a/wger/manager/views/workout.py
+++ b/wger/manager/views/workout.py
@@ -15,9 +15,7 @@
# You should have received a copy of the GNU Affero General Public License
# Standard Library
-import copy
import logging
-from typing import List
# Django
from django.contrib.auth.decorators import login_required
@@ -36,9 +34,7 @@ from django.views.generic import UpdateView
# wger
from wger.manager.forms import WorkoutMakeTemplateForm
from wger.manager.models import (
- AbstractChangeConfig,
Routine,
- SlotEntry,
Workout,
)
from wger.utils.generic_views import WgerFormMixin
diff --git a/wger/measurements/models/measurement.py b/wger/measurements/models/measurement.py
index dcecad700..90cdfd034 100644
--- a/wger/measurements/models/measurement.py
+++ b/wger/measurements/models/measurement.py
@@ -18,7 +18,6 @@
import datetime
# Django
-from django.contrib.auth.models import User
from django.core.validators import (
MaxValueValidator,
MinValueValidator,
diff --git a/wger/nutrition/dataclasses.py b/wger/nutrition/dataclasses.py
index d87408b9f..606a0a70b 100644
--- a/wger/nutrition/dataclasses.py
+++ b/wger/nutrition/dataclasses.py
@@ -45,7 +45,7 @@ class IngredientData:
def sanity_checks(self):
if not self.name:
- raise ValueError(f'Name is empty!')
+ raise ValueError('Name is empty!')
self.name = self.name[:200]
self.brand = self.brand[:200]
self.common_name = self.common_name[:200]
@@ -65,7 +65,7 @@ class IngredientData:
raise ValueError(f'Value for {macro} is greater than 100: {value}')
if self.carbohydrates + self.protein + self.fat > 100:
- raise ValueError(f'Total of carbohydrates, protein and fat is greater than 100!')
+ raise ValueError('Total of carbohydrates, protein and fat is greater than 100!')
def dict(self):
return asdict(self)
diff --git a/wger/nutrition/forms.py b/wger/nutrition/forms.py
index 1e3539180..13e6aaecc 100644
--- a/wger/nutrition/forms.py
+++ b/wger/nutrition/forms.py
@@ -45,7 +45,6 @@ from wger.nutrition.models import (
Ingredient,
IngredientWeightUnit,
LogItem,
- Meal,
MealItem,
)
from wger.utils.widgets import Html5NumberInput
diff --git a/wger/nutrition/management/commands/import-off-products.py b/wger/nutrition/management/commands/import-off-products.py
index ffad7af79..8b74f09ef 100644
--- a/wger/nutrition/management/commands/import-off-products.py
+++ b/wger/nutrition/management/commands/import-off-products.py
@@ -70,7 +70,7 @@ class Command(ImportProductCommand):
for product in db.products.find({'lang': {'$in': list(languages.keys())}}):
try:
ingredient_data = extract_info_from_off(product, languages[product['lang']])
- except (KeyError, ValueError) as e:
+ except (KeyError, ValueError):
# self.stdout.write(f'--> KeyError while extracting info from OFF: {e}')
self.counter['skipped'] += 1
else:
@@ -141,11 +141,11 @@ class Command(ImportProductCommand):
self.stdout.write('Importing entries from Open Food Facts')
self.stdout.write(f' - {self.mode}')
if options['delta_updates']:
- self.stdout.write(f' - importing only delta updates')
+ self.stdout.write(' - importing only delta updates')
elif options['use_jsonl']:
- self.stdout.write(f' - importing the full dump')
+ self.stdout.write(' - importing the full dump')
else:
- self.stdout.write(f' - importing from mongo')
+ self.stdout.write(' - importing from mongo')
self.stdout.write('')
languages = {lang.short_name: lang.pk for lang in Language.objects.all()}
diff --git a/wger/nutrition/management/products.py b/wger/nutrition/management/products.py
index c7197bb96..e9a96cb27 100644
--- a/wger/nutrition/management/products.py
+++ b/wger/nutrition/management/products.py
@@ -168,11 +168,11 @@ class ImportProductCommand(BaseCommand):
for line in gzid:
try:
product = json.loads(line)
- if not product.get('lang') in languages:
+ if product.get('lang') not in languages:
continue
yield product
except JSONDecodeError:
- self.stdout.write(f' Error parsing and/or filtering json record, skipping')
+ self.stdout.write(' Error parsing and/or filtering json record, skipping')
continue
def download_file(self, url: str, destination: str) -> None:
diff --git a/wger/nutrition/migrations/0020_full_text_search.py b/wger/nutrition/migrations/0020_full_text_search.py
index bb779690f..6e57f07b7 100644
--- a/wger/nutrition/migrations/0020_full_text_search.py
+++ b/wger/nutrition/migrations/0020_full_text_search.py
@@ -2,7 +2,7 @@
import django.contrib.postgres.indexes
import django.contrib.postgres.search
-from django.db import migrations, models
+from django.db import migrations
class Migration(migrations.Migration):
diff --git a/wger/nutrition/models/image.py b/wger/nutrition/models/image.py
index 00877b077..8136cd6b6 100644
--- a/wger/nutrition/models/image.py
+++ b/wger/nutrition/models/image.py
@@ -23,7 +23,6 @@ from django.db import models
from django.utils.translation import gettext_lazy as _
# wger
-from wger.core.models import License
from wger.utils.helpers import BaseImage
from wger.utils.models import AbstractLicenseModel
diff --git a/wger/nutrition/models/plan.py b/wger/nutrition/models/plan.py
index 8cea374fb..bebc4923c 100644
--- a/wger/nutrition/models/plan.py
+++ b/wger/nutrition/models/plan.py
@@ -17,7 +17,6 @@
# Standard Library
import datetime
import logging
-from decimal import Decimal
# Django
from django.contrib.auth.models import User
@@ -30,7 +29,6 @@ from django.utils.translation import gettext_lazy as _
from wger.nutrition.consts import ENERGY_FACTOR
from wger.nutrition.helpers import NutritionalValues
from wger.utils.cache import cache_mapper
-from wger.utils.constants import TWOPLACES
from wger.weight.models import WeightEntry
diff --git a/wger/nutrition/tests/test_nutritional_calculations.py b/wger/nutrition/tests/test_nutritional_calculations.py
index 0bcc745fa..4d0e38ef0 100644
--- a/wger/nutrition/tests/test_nutritional_calculations.py
+++ b/wger/nutrition/tests/test_nutritional_calculations.py
@@ -20,7 +20,6 @@ from decimal import Decimal
# wger
from wger.core.tests.base_testcase import WgerTestCase
from wger.nutrition import models
-from wger.utils.constants import TWOPLACES
logger = logging.getLogger(__name__)
diff --git a/wger/nutrition/urls.py b/wger/nutrition/urls.py
index 97c94c2ed..828a2ab80 100644
--- a/wger/nutrition/urls.py
+++ b/wger/nutrition/urls.py
@@ -18,10 +18,7 @@
# Django
from django.conf.urls import include
from django.contrib.auth.decorators import login_required
-from django.urls import (
- path,
- re_path,
-)
+from django.urls import path
# wger
from wger.core.views.react import ReactView
diff --git a/wger/nutrition/usda.py b/wger/nutrition/usda.py
index 9e14bd213..befdbe28c 100644
--- a/wger/nutrition/usda.py
+++ b/wger/nutrition/usda.py
@@ -91,7 +91,7 @@ def extract_info_from_usda(product_data: dict, language: int) -> IngredientData:
# License and author info
source_name = Source.USDA.value
- source_url = f'https://fdc.nal.usda.gov/'
+ source_url = 'https://fdc.nal.usda.gov/'
author = (
'U.S. Department of Agriculture, Agricultural Research Service, '
'Beltsville Human Nutrition Research Center. FoodData Central.'
diff --git a/wger/nutrition/views/plan.py b/wger/nutrition/views/plan.py
index 785ba2fe7..ec63ec2f4 100644
--- a/wger/nutrition/views/plan.py
+++ b/wger/nutrition/views/plan.py
@@ -50,6 +50,7 @@ from wger.utils.pdf import (
styleSheet,
)
+
logger = logging.getLogger(__name__)
diff --git a/wger/utils/helpers.py b/wger/utils/helpers.py
index a3f6cb701..a0e9e99e3 100644
--- a/wger/utils/helpers.py
+++ b/wger/utils/helpers.py
@@ -27,16 +27,13 @@ from functools import wraps
# Django
from django.contrib.auth.models import User
-from django.contrib.auth.tokens import default_token_generator
from django.core.files import File
from django.core.files.temp import NamedTemporaryFile
from django.http import Http404
from django.shortcuts import get_object_or_404
from django.utils.encoding import force_bytes
-from django.utils.http import (
- urlsafe_base64_decode,
- urlsafe_base64_encode,
-)
+from django.utils.http import urlsafe_base64_encode
+
logger = logging.getLogger(__name__)
diff --git a/wger/weight/migrations/0002_auto_20150604_2139.py b/wger/weight/migrations/0002_auto_20150604_2139.py
index 34007a62d..7f7595a38 100644
--- a/wger/weight/migrations/0002_auto_20150604_2139.py
+++ b/wger/weight/migrations/0002_auto_20150604_2139.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-from django.db import models, migrations
+from django.db import migrations
class Migration(migrations.Migration):
diff --git a/wger/weight/tests/test_entry.py b/wger/weight/tests/test_entry.py
index 8af3955d0..d186316bf 100644
--- a/wger/weight/tests/test_entry.py
+++ b/wger/weight/tests/test_entry.py
@@ -16,9 +16,6 @@
import datetime
import decimal
-# Django
-from django.urls import reverse
-
# wger
from wger.core.tests import api_base_test
from wger.core.tests.base_testcase import (
diff --git a/wger/weight/views.py b/wger/weight/views.py
index 25d764896..c9dd8b38e 100644
--- a/wger/weight/views.py
+++ b/wger/weight/views.py
@@ -26,7 +26,6 @@ from django.http import (
HttpResponse,
HttpResponseRedirect,
)
-from django.shortcuts import render
from django.urls import reverse
from django.utils.translation import (
gettext as _,
@@ -46,7 +45,6 @@ from wger.utils.generic_views import (
WgerDeleteMixin,
WgerFormMixin,
)
-from wger.utils.helpers import check_access
from wger.weight import helpers
from wger.weight.forms import WeightForm
from wger.weight.models import WeightEntry