Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Remove unnecessary object

Roland Geiderdf35963cdf5d
diff --git a/wger/core/tests/api_base_test.py b/wger/core/tests/api_base_test.py
index 13626d788..c8ca8793c 100644
--- a/wger/core/tests/api_base_test.py
+++ b/wger/core/tests/api_base_test.py
@@ -439,7 +439,7 @@ class ApiPatchTestCase:
self.assertEqual(response.status_code, status.HTTP_405_METHOD_NOT_ALLOWED)
-class ApiPutTestCase(object):
+class ApiPutTestCase:
"""
Base test case for testing PUT access to the API
"""
@@ -468,7 +468,7 @@ class ApiPutTestCase(object):
# Even if we PUT to a detail resource that does not belong to us,
# the created object will have the correct user assigned.
#
- # Currently resources that have a 'user' field 'succeed'
+ # Currently, resources that have a 'user' field 'succeed'
if response.status_code == status.HTTP_201_CREATED:
# print(f'201: {self.url_detail}')
obj = self.resource.objects.get(pk=response.data['id'])
@@ -566,7 +566,7 @@ class ApiPutTestCase(object):
self.assertEqual(response.status_code, status.HTTP_405_METHOD_NOT_ALLOWED)
-class ApiDeleteTestCase(object):
+class ApiDeleteTestCase:
"""
Base test case for testing DELETE access to the API
"""
diff --git a/wger/nutrition/helpers.py b/wger/nutrition/helpers.py
index d663c13e8..31dd1c9bc 100644
--- a/wger/nutrition/helpers.py
+++ b/wger/nutrition/helpers.py
@@ -26,7 +26,7 @@ from wger.utils.constants import TWOPLACES
from wger.utils.units import AbstractWeight
-class BaseMealItem(object):
+class BaseMealItem:
"""
Base class for an item (component) of a meal or log
diff --git a/wger/utils/cache.py b/wger/utils/cache.py
index 1c85cf247..238d43067 100644
--- a/wger/utils/cache.py
+++ b/wger/utils/cache.py
@@ -47,7 +47,7 @@ def reset_workout_log(user_pk, year, month, day=None):
cache.delete(cache_mapper.get_workout_log_list(log_hash))
-class CacheKeyMapper(object):
+class CacheKeyMapper:
"""
Simple class for mapping the cache keys of different objects
"""
diff --git a/wger/utils/generic_views.py b/wger/utils/generic_views.py
index d05d663f6..a20e53d31 100644
--- a/wger/utils/generic_views.py
+++ b/wger/utils/generic_views.py
@@ -64,7 +64,7 @@ class WgerMultiplePermissionRequiredMixin(PermissionRequiredMixin):
return False
-class WgerPermissionMixin(object):
+class WgerPermissionMixin:
"""
Custom permission mixim
diff --git a/wger/utils/helpers.py b/wger/utils/helpers.py
index 91c8acfd3..d88e94fe8 100644
--- a/wger/utils/helpers.py
+++ b/wger/utils/helpers.py
@@ -41,7 +41,7 @@ from django.utils.http import (
logger = logging.getLogger(__name__)
-class EmailAuthBackend(object):
+class EmailAuthBackend:
def authenticate(self, request, username=None, password=None):
try:
diff --git a/wger/utils/units.py b/wger/utils/units.py
index 1fc055968..bdcf79c89 100644
--- a/wger/utils/units.py
+++ b/wger/utils/units.py
@@ -26,7 +26,7 @@ Weight unit classes
"""
-class AbstractWeight(object):
+class AbstractWeight:
"""
Helper class to use when working with sensible (kg) or imperial units.