Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Automatic linting

Github-actions14979faeeda7
diff --git a/wger/manager/api/views.py b/wger/manager/api/views.py
index 977dc0984..f62dd9922 100644
--- a/wger/manager/api/views.py
+++ b/wger/manager/api/views.py
@@ -19,6 +19,7 @@
from django.conf import settings
from django.core.cache import cache
from django.db.models import Q
+
# Third Party
from rest_framework import viewsets
from rest_framework.decorators import action
diff --git a/wger/nutrition/management/commands/sync-ingredients.py b/wger/nutrition/management/commands/sync-ingredients.py
index 431e1f3e0..1d9d3f92c 100644
--- a/wger/nutrition/management/commands/sync-ingredients.py
+++ b/wger/nutrition/management/commands/sync-ingredients.py
@@ -61,5 +61,5 @@ class Command(WgerCommand):
self.remote_url,
languages,
self.style.SUCCESS,
- show_progress_bar=True
+ show_progress_bar=True,
)
diff --git a/wger/nutrition/sync.py b/wger/nutrition/sync.py
index af06317ec..66f01acaf 100644
--- a/wger/nutrition/sync.py
+++ b/wger/nutrition/sync.py
@@ -286,10 +286,7 @@ def sync_ingredients(
ingredient_nr = 1
page_nr = 1
pbar = tqdm(
- total=total_ingredients,
- unit='ingredients',
- desc='Syncing progress',
- unit_scale=True
+ total=total_ingredients, unit='ingredients', desc='Syncing progress', unit_scale=True
)
for data in get_paginated(url, headers=wger_headers()):
uuid = data['uuid']
@@ -297,10 +294,7 @@ def sync_ingredients(
ingredient_data = extract_info_from_wger_api(data).dict()
ingredient_data['uuid'] = uuid
- Ingredient.objects.update_or_create(
- uuid=uuid,
- defaults=ingredient_data
- )
+ Ingredient.objects.update_or_create(uuid=uuid, defaults=ingredient_data)
if show_progress_bar:
pbar.update(1)
diff --git a/wger/nutrition/tasks.py b/wger/nutrition/tasks.py
index 0050e34f6..b8f648779 100644
--- a/wger/nutrition/tasks.py
+++ b/wger/nutrition/tasks.py
@@ -19,13 +19,14 @@ from random import (
randint,
)
-# Third Party
-from celery import shared_task
-from celery.schedules import crontab
# Django
from django.conf import settings
from django.core.management import call_command
+# Third Party
+from celery import shared_task
+from celery.schedules import crontab
+
# wger
from wger.celery_configuration import app
from wger.nutrition.sync import (
@@ -34,6 +35,7 @@ from wger.nutrition.sync import (
sync_ingredients,
)
+
logger = logging.getLogger(__name__)
@@ -62,10 +64,7 @@ def sync_all_ingredients_task():
"""
Fetches the current ingredients from the default wger instance
"""
- sync_ingredients(
- logger.info,
- show_progress_bar=False
- )
+ sync_ingredients(logger.info, show_progress_bar=False)
@app.task