From 17557c8c6fd92ec7019ec98b19857e2e61789596 Mon Sep 17 00:00:00 2001 From: Harlene Samra Date: Wed, 9 Dec 2020 09:18:36 -0500 Subject: [PATCH] Fixing style --- wger/nutrition/forms.py | 25 +++++++++++++------------ wger/nutrition/views/ingredient.py | 4 ++-- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/wger/nutrition/forms.py b/wger/nutrition/forms.py index a2ab136c3..84c837b0e 100644 --- a/wger/nutrition/forms.py +++ b/wger/nutrition/forms.py @@ -260,21 +260,22 @@ class Meta: 'weight_unit', 'amount'] + class IngredientForm(forms.ModelForm): class Meta: model = Ingredient fields = ['name', - 'energy', - 'protein', - 'carbohydrates', - 'carbohydrates_sugar', - 'fat', - 'fat_saturated', - 'fibres', - 'sodium', - 'license', - 'license_author'] - + 'energy', + 'protein', + 'carbohydrates', + 'carbohydrates_sugar', + 'fat', + 'fat_saturated', + 'fibres', + 'sodium', + 'license', + 'license_author'] + def __init__(self, *args, **kwargs): super(IngredientForm, self).__init__(*args, **kwargs) self.helper = FormHelper() @@ -296,4 +297,4 @@ def __init__(self, *args, **kwargs): 'sodium', 'license', 'license_author' - ) \ No newline at end of file + ) diff --git a/wger/nutrition/views/ingredient.py b/wger/nutrition/views/ingredient.py index 07526c138..6747ed718 100644 --- a/wger/nutrition/views/ingredient.py +++ b/wger/nutrition/views/ingredient.py @@ -46,7 +46,7 @@ ) # wger -from wger.nutrition.forms import ( +from wger.nutrition.forms import ( UnitChooserForm, IngredientForm, ) @@ -187,7 +187,7 @@ def dispatch(self, request, *args, **kwargs): if request.user.userprofile.is_temporary: return HttpResponseForbidden() return super(IngredientCreateView, self).dispatch(request, *args, **kwargs) - + def get_context_data(self, **kwargs): context = super(IngredientCreateView, self).get_context_data(**kwargs) context['extend_template'] = 'base.html'