fixed import error
This commit is contained in:
@ -105,7 +105,7 @@ def find_recipe_json(ld_json, url):
|
||||
else:
|
||||
ld_json['recipeInstructions'] = ''
|
||||
|
||||
ld_json['recipeInstructions'] += _('Imported from ') + url
|
||||
ld_json['recipeInstructions'] += '\n\n' + _('Imported from ') + url
|
||||
|
||||
if 'image' in ld_json:
|
||||
# check if list of images is returned, take first if so
|
||||
|
@ -86,7 +86,7 @@
|
||||
:options="units"
|
||||
:close-on-select="true"
|
||||
:clear-on-select="true"
|
||||
:hide-selected="true"
|
||||
|
||||
:preserve-search="true"
|
||||
placeholder="{% trans 'Select one' %}"
|
||||
tag-placeholder="{% trans 'Create new' %}"
|
||||
@ -110,7 +110,7 @@
|
||||
tag-placeholder="{% trans 'Create new' %}"
|
||||
:close-on-select="true"
|
||||
:clear-on-select="true"
|
||||
:hide-selected="true"
|
||||
|
||||
:preserve-search="true"
|
||||
label="text"
|
||||
:id="index"
|
||||
|
@ -116,7 +116,10 @@ def import_url(request):
|
||||
|
||||
for ing in data['recipeIngredient']:
|
||||
i, i_created = Ingredient.objects.get_or_create(name=ing['ingredient']['text'])
|
||||
if ing['unit']:
|
||||
u, u_created = Unit.objects.get_or_create(name=ing['unit']['text'])
|
||||
else:
|
||||
u = Unit.objects.get(name=request.user.userpreference.default_unit)
|
||||
|
||||
if isinstance(ing['amount'], str):
|
||||
try:
|
||||
|
Reference in New Issue
Block a user