Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Automatic linting

Github-actions25cb3538695e
diff --git a/wger/nutrition/management/commands/import-off-products.py b/wger/nutrition/management/commands/import-off-products.py
index 449764c7d..db15bd693 100644
--- a/wger/nutrition/management/commands/import-off-products.py
+++ b/wger/nutrition/management/commands/import-off-products.py
@@ -27,6 +27,7 @@ from wger.nutrition.management.products import (
Mode,
)
+
logger = logging.getLogger(__name__)
diff --git a/wger/nutrition/management/commands/import-usda-products.py b/wger/nutrition/management/commands/import-usda-products.py
index 145cbcb16..53e238cbe 100644
--- a/wger/nutrition/management/commands/import-usda-products.py
+++ b/wger/nutrition/management/commands/import-usda-products.py
@@ -28,6 +28,7 @@ from wger.nutrition.management.products import (
)
from wger.utils.constants import ENGLISH_SHORT_NAME
+
logger = logging.getLogger(__name__)
@@ -46,8 +47,8 @@ class Command(ImportProductCommand):
dest='dataset',
type=str,
help='What dataset to download, this value will be appended to '
- '"https://fdc.nal.usda.gov/fdc-datasets/". Consult '
- 'https://fdc.nal.usda.gov/download-datasets.html for current file names',
+ '"https://fdc.nal.usda.gov/fdc-datasets/". Consult '
+ 'https://fdc.nal.usda.gov/download-datasets.html for current file names',
)
def handle(self, **options):
diff --git a/wger/nutrition/models/ingredient.py b/wger/nutrition/models/ingredient.py
index 9aeaf8f0c..6115acb88 100644
--- a/wger/nutrition/models/ingredient.py
+++ b/wger/nutrition/models/ingredient.py
@@ -35,6 +35,7 @@ from django.http import HttpRequest
from django.urls import reverse
from django.utils.text import slugify
from django.utils.translation import gettext_lazy as _
+
# Third Party
from openfoodfacts import API
from requests import (
@@ -58,6 +59,7 @@ from wger.utils.language import load_language
from wger.utils.models import AbstractLicenseModel
from wger.utils.requests import wger_user_agent
+
logger = logging.getLogger(__name__)
@@ -344,16 +346,16 @@ class Ingredient(AbstractLicenseModel, models.Model):
equal = True
if isinstance(other, self.__class__):
for i in (
- 'carbohydrates',
- 'carbohydrates_sugar',
- 'creation_date',
- 'energy',
- 'fat',
- 'fat_saturated',
- 'fiber',
- 'name',
- 'protein',
- 'sodium',
+ 'carbohydrates',
+ 'carbohydrates_sugar',
+ 'creation_date',
+ 'energy',
+ 'fat',
+ 'fat_saturated',
+ 'fiber',
+ 'name',
+ 'protein',
+ 'sodium',
):
if (
hasattr(self, i)
diff --git a/wger/nutrition/sync.py b/wger/nutrition/sync.py
index b086a935b..2918dcff2 100644
--- a/wger/nutrition/sync.py
+++ b/wger/nutrition/sync.py
@@ -20,12 +20,13 @@ from typing import (
Optional,
)
-# Third Party
-import requests
# Django
from django.conf import settings
from django.db import IntegrityError
from django.utils import timezone
+
+# Third Party
+import requests
from openfoodfacts.images import (
AWS_S3_BASE_URL,
generate_image_path,
@@ -56,6 +57,7 @@ from wger.utils.requests import (
)
from wger.utils.url import make_uri
+
logger = logging.getLogger(__name__)
@@ -80,8 +82,8 @@ def fetch_ingredient_image(pk: int):
if (
ingredient.last_image_check
and (
- ingredient.last_image_check + settings.WGER_SETTINGS['INGREDIENT_IMAGE_CHECK_INTERVAL']
- )
+ ingredient.last_image_check + settings.WGER_SETTINGS['INGREDIENT_IMAGE_CHECK_INTERVAL']
+ )
> timezone.now()
):
# logger.debug(
diff --git a/wger/nutrition/tests/test_usda.py b/wger/nutrition/tests/test_usda.py
index 7bba179d4..fe6f7d0f4 100644
--- a/wger/nutrition/tests/test_usda.py
+++ b/wger/nutrition/tests/test_usda.py
@@ -226,7 +226,7 @@ class ExtractInfoFromUSDATestCase(SimpleTestCase):
brand='',
license_id=CC_0_LICENSE_ID,
license_author='U.S. Department of Agriculture, Agricultural Research Service, '
- 'Beltsville Human Nutrition Research Center. FoodData Central.',
+ 'Beltsville Human Nutrition Research Center. FoodData Central.',
license_title='Foo With Chocolate',
license_object_url='https://fdc.nal.usda.gov/fdc-app.html#/food-details/1234567/nutrients',
)