bug: relacionamento id mesa com comanda resolvido

This commit is contained in:
2025-01-15 14:04:04 -03:00
parent 2ceae1c0e9
commit 0d6a164872
3 changed files with 1 additions and 1 deletions

View File

@@ -41,7 +41,7 @@ def viewComanda(request):
@group_required(groupName='Garçom')
def createComanda(request):
name = request.POST.get('name-comanda')
mesa_id = int(request.POST.get('select-mesa')[0])
mesa_id = int(request.POST.get('select-mesa'))
mesa = Mesa.objects.get(id=mesa_id)
comanda = Comanda(name=name, mesa=mesa, user=request.user)
comanda.save()