mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-01 12:18:45 -05:00
bug fix url import
This commit is contained in:
@@ -614,31 +614,6 @@ def get_plan_ical(request, from_date, to_date):
|
||||
return response
|
||||
|
||||
|
||||
@group_required('user')
|
||||
def recipe_from_json(request):
|
||||
mjson = request.POST['json']
|
||||
|
||||
md_json = json.loads(mjson)
|
||||
for ld_json_item in md_json:
|
||||
# recipes type might be wrapped in @graph type
|
||||
if '@graph' in ld_json_item:
|
||||
for x in md_json['@graph']:
|
||||
if '@type' in x and x['@type'] == 'Recipe':
|
||||
md_json = x
|
||||
|
||||
if ('@type' in md_json
|
||||
and md_json['@type'] == 'Recipe'):
|
||||
return JsonResponse(find_recipe_json(md_json, '', request.space))
|
||||
|
||||
return JsonResponse(
|
||||
{
|
||||
'error': True,
|
||||
'msg': _('Could not parse correctly...')
|
||||
},
|
||||
status=400
|
||||
)
|
||||
|
||||
|
||||
@group_required('user')
|
||||
def recipe_from_source(request):
|
||||
url = request.POST.get('url', None)
|
||||
|
||||
Reference in New Issue
Block a user