Self hosted FLOSS fitness/workout, nutrition and weight tracker
Formatting
Roland Geider0179f10a0750
diff --git a/wger/nutrition/api/serializers.py b/wger/nutrition/api/serializers.pyindex 323700dae..3030ecfc7 100644--- a/wger/nutrition/api/serializers.py+++ b/wger/nutrition/api/serializers.py@@ -20,13 +20,14 @@ from rest_framework import serializers# wgerfrom wger.nutrition.models import (+ Image,Ingredient,IngredientWeightUnit,LogItem,Meal,MealItem,NutritionPlan,- WeightUnit, Image,+ WeightUnit,)diff --git a/wger/nutrition/api/views.py b/wger/nutrition/api/views.pyindex 2f00fa38d..b3920663d 100644--- a/wger/nutrition/api/views.py+++ b/wger/nutrition/api/views.py@@ -31,6 +31,7 @@ from rest_framework.response import Response# wgerfrom wger.nutrition.api.serializers import (+ ImageSerializer,IngredientInfoSerializer,IngredientSerializer,IngredientWeightUnitSerializer,@@ -39,17 +40,18 @@ from wger.nutrition.api.serializers import (MealSerializer,NutritionPlanInfoSerializer,NutritionPlanSerializer,- WeightUnitSerializer, ImageSerializer,+ WeightUnitSerializer,)from wger.nutrition.forms import UnitChooserFormfrom wger.nutrition.models import (+ Image,Ingredient,IngredientWeightUnit,LogItem,Meal,MealItem,NutritionPlan,- WeightUnit, Image,+ WeightUnit,)from wger.utils.language import (load_ingredient_languages,diff --git a/wger/nutrition/models/ingredient.py b/wger/nutrition/models/ingredient.pyindex 1fef89936..510105c40 100644--- a/wger/nutrition/models/ingredient.py+++ b/wger/nutrition/models/ingredient.py@@ -99,7 +99,6 @@ class Ingredient(AbstractSubmissionModel, AbstractLicenseModel, models.Model):)"""Date when the ingredient was created"""-update_date = models.DateField(_('Date'),auto_now=True,@@ -450,7 +449,10 @@ class Ingredient(AbstractSubmissionModel, AbstractLicenseModel, models.Model):if not settings.WGER_SETTINGS['DOWNLOAD_FROM_OFF']:return- headers = {'User-agent': default_user_agent(f'wger/{get_version()} - https://github.com/wger-project/flutter')}+ headers = {+ 'User-agent':+ default_user_agent(f'wger/{get_version()} - https://github.com/wger-project')+ }product_data = requests.get(self.source_url, headers=headers).json()image_url: Optional[str] = product_data['product'].get('image_front_url')@@ -472,8 +474,10 @@ class Ingredient(AbstractSubmissionModel, AbstractLicenseModel, models.Model):return#- image_data: dict = {'image': os.path.basename(image_url),- 'license_author': uploader_name,- 'size': len(downloaded_image.content)}+ image_data: dict = {+ 'image': os.path.basename(image_url),+ 'license_author': uploader_name,+ 'size': len(downloaded_image.content)+ }return Image.from_json(self, downloaded_image, image_data, headers, generate_uuid=True)diff --git a/wger/nutrition/views/ingredient.py b/wger/nutrition/views/ingredient.pyindex 2e73708a7..8dfdbc0e6 100644--- a/wger/nutrition/views/ingredient.py+++ b/wger/nutrition/views/ingredient.py@@ -62,6 +62,7 @@ from wger.utils.language import (load_language,)+logger = logging.getLogger(__name__)diff --git a/wger/tasks.py b/wger/tasks.pyindex b03f5b58f..077e50dcc 100644--- a/wger/tasks.py+++ b/wger/tasks.py@@ -52,9 +52,7 @@ FIXTURE_URL = 'https://github.com/wger-project/data/raw/master/fixtures/''"--arg1 --arg2=value". Default: none'})-def start(- context, address='localhost', port=8000, settings_path=None, extra_args=''-):+def start(context, address='localhost', port=8000, settings_path=None, extra_args=''):"""Start the application using django's built in webserver"""