Skip to content

Commit 14979fa

Browse files
author
Github-actions
committed
Automatic linting
1 parent 8f1f3e5 commit 14979fa

File tree

4 files changed

+10
-16
lines changed

4 files changed

+10
-16
lines changed

wger/manager/api/views.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from django.conf import settings
2020
from django.core.cache import cache
2121
from django.db.models import Q
22+
2223
# Third Party
2324
from rest_framework import viewsets
2425
from rest_framework.decorators import action

wger/nutrition/management/commands/sync-ingredients.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,5 @@ def handle(self, **options):
6161
self.remote_url,
6262
languages,
6363
self.style.SUCCESS,
64-
show_progress_bar=True
64+
show_progress_bar=True,
6565
)

wger/nutrition/sync.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -286,21 +286,15 @@ def sync_ingredients(
286286
ingredient_nr = 1
287287
page_nr = 1
288288
pbar = tqdm(
289-
total=total_ingredients,
290-
unit='ingredients',
291-
desc='Syncing progress',
292-
unit_scale=True
289+
total=total_ingredients, unit='ingredients', desc='Syncing progress', unit_scale=True
293290
)
294291
for data in get_paginated(url, headers=wger_headers()):
295292
uuid = data['uuid']
296293

297294
ingredient_data = extract_info_from_wger_api(data).dict()
298295
ingredient_data['uuid'] = uuid
299296

300-
Ingredient.objects.update_or_create(
301-
uuid=uuid,
302-
defaults=ingredient_data
303-
)
297+
Ingredient.objects.update_or_create(uuid=uuid, defaults=ingredient_data)
304298

305299
if show_progress_bar:
306300
pbar.update(1)

wger/nutrition/tasks.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,14 @@
1919
randint,
2020
)
2121

22-
# Third Party
23-
from celery import shared_task
24-
from celery.schedules import crontab
2522
# Django
2623
from django.conf import settings
2724
from django.core.management import call_command
2825

26+
# Third Party
27+
from celery import shared_task
28+
from celery.schedules import crontab
29+
2930
# wger
3031
from wger.celery_configuration import app
3132
from wger.nutrition.sync import (
@@ -34,6 +35,7 @@
3435
sync_ingredients,
3536
)
3637

38+
3739
logger = logging.getLogger(__name__)
3840

3941

@@ -62,10 +64,7 @@ def sync_all_ingredients_task():
6264
"""
6365
Fetches the current ingredients from the default wger instance
6466
"""
65-
sync_ingredients(
66-
logger.info,
67-
show_progress_bar=False
68-
)
67+
sync_ingredients(logger.info, show_progress_bar=False)
6968

7069

7170
@app.task

0 commit comments

Comments
 (0)