Skip to content

Commit

Permalink
Fixing style
Browse files Browse the repository at this point in the history
  • Loading branch information
harlenesamra committed Dec 9, 2020
1 parent 675647b commit 17557c8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
25 changes: 13 additions & 12 deletions wger/nutrition/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -296,4 +297,4 @@ def __init__(self, *args, **kwargs):
'sodium',
'license',
'license_author'
)
)
4 changes: 2 additions & 2 deletions wger/nutrition/views/ingredient.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
)

# wger
from wger.nutrition.forms import (
from wger.nutrition.forms import (
UnitChooserForm,
IngredientForm,
)
Expand Down Expand Up @@ -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'
Expand Down

0 comments on commit 17557c8

Please sign in to comment.