Merge branch 'develop' into feature/importer_to_vue

This commit is contained in:
vabene1111
2022-03-15 13:02:10 +01:00
7 changed files with 430 additions and 18 deletions

View File

@@ -1,4 +1,5 @@
import json
import traceback
import requests
from django.db.models import Q
@@ -52,10 +53,10 @@ def hook(request, token):
f = ingredient_parser.get_food(food)
u = ingredient_parser.get_unit(unit)
ShoppingListEntry.objects.create(food=f, unit=u, amount=amount, original_text=ingredient, created_by=request.user, space=request.space)
ShoppingListEntry.objects.create(food=f, unit=u, amount=amount, created_by=request.user, space=request.space)
return JsonResponse({'data': data['message']['text']})
except Exception:
pass
traceback.print_exc()
return JsonResponse({})