Self hosted FLOSS fitness/workout, nutrition and weight tracker
Show log message when celery is not configured
Roland Geider2be0d2ad46f8
diff --git a/wger/nutrition/management/commands/download-off-ingredient-images.py b/wger/nutrition/management/commands/download-off-ingredient-images.pyindex cadc5d4cb..4e30a4b82 100644--- a/wger/nutrition/management/commands/download-off-ingredient-images.py+++ b/wger/nutrition/management/commands/download-off-ingredient-images.py@@ -1,5 +1,3 @@-# -*- coding: utf-8 *-*-# This file is part of wger Workout Manager.## wger Workout Manager is free software: you can redistribute it and/or modify@@ -15,6 +13,7 @@# You should have received a copy of the GNU Affero General Public License# Standard Library+import logging# Djangofrom django.conf import settings@@ -25,6 +24,9 @@ from wger.nutrition.tasks import fetch_ingredient_imagefrom wger.nutrition.models import MealItem+logger = logging.getLogger(__name__)++class Command(BaseCommand):"""One off script@@ -37,6 +39,7 @@ class Command(BaseCommand):def handle(self, **options):if not settings.WGER_SETTINGS['USE_CELERY']:+ logger.info('Celery deactivated, skipping task')return# Make sure off downloads are enableddiff --git a/wger/nutrition/models/ingredient.py b/wger/nutrition/models/ingredient.pyindex 143956508..6c0b6b126 100644--- a/wger/nutrition/models/ingredient.py+++ b/wger/nutrition/models/ingredient.py@@ -449,6 +449,7 @@ class Ingredient(AbstractSubmissionModel, AbstractLicenseModel, models.Model):returnif not settings.WGER_SETTINGS['USE_CELERY']:+ logger.info('Celery deactivated, skipping task')return# Let celery fetch the image