diff --git a/gestaoRaul/comandas/__pycache__/htmx_views.cpython-312.pyc b/gestaoRaul/comandas/__pycache__/htmx_views.cpython-312.pyc index 10c988b..61bd42d 100644 Binary files a/gestaoRaul/comandas/__pycache__/htmx_views.cpython-312.pyc and b/gestaoRaul/comandas/__pycache__/htmx_views.cpython-312.pyc differ diff --git a/gestaoRaul/comandas/htmx_views.py b/gestaoRaul/comandas/htmx_views.py index aedeb1c..5973fab 100644 --- a/gestaoRaul/comandas/htmx_views.py +++ b/gestaoRaul/comandas/htmx_views.py @@ -86,7 +86,8 @@ def addProduct(request, product_id, comanda_id): 'id':order.id, 'speak': f'Novo pedido! {product.name}, para {comanda.name}.' }) - asyncio.run(enviar_mensagem(msg)) + + # asyncio.run(enviar_mensagem(msg)) consumo = ProductComanda.objects.filter(comanda=comanda_id) valores = somar(consumo,comanda) diff --git a/gestaoRaul/comandas/templatetags/__pycache__/custom_filter_tag.cpython-312.pyc b/gestaoRaul/comandas/templatetags/__pycache__/custom_filter_tag.cpython-312.pyc index fdc0291..15d6c8d 100644 Binary files a/gestaoRaul/comandas/templatetags/__pycache__/custom_filter_tag.cpython-312.pyc and b/gestaoRaul/comandas/templatetags/__pycache__/custom_filter_tag.cpython-312.pyc differ diff --git a/gestaoRaul/comandas/templatetags/custom_filter_tag.py b/gestaoRaul/comandas/templatetags/custom_filter_tag.py index e1c3a36..2f29302 100644 --- a/gestaoRaul/comandas/templatetags/custom_filter_tag.py +++ b/gestaoRaul/comandas/templatetags/custom_filter_tag.py @@ -59,8 +59,11 @@ def has_group(user, group_name): @register.filter(name='obsOrder') def obsOrder(id): - productComanda_obj = ProductComanda.objects.get(pk=id) - order = Order.objects.get(productComanda=productComanda_obj) - return order.obs + try: + productComanda_obj = ProductComanda.objects.get(pk=id) + order = Order.objects.get(productComanda=productComanda_obj) + return order.obs + except: + return '' \ No newline at end of file diff --git a/gestaoRaul/db.sqlite3 b/gestaoRaul/db.sqlite3 index b1d4b73..8440ba1 100644 Binary files a/gestaoRaul/db.sqlite3 and b/gestaoRaul/db.sqlite3 differ diff --git a/gestaoRaul/templates/htmx_components/comandas/htmx_list_products_in_comanda.html b/gestaoRaul/templates/htmx_components/comandas/htmx_list_products_in_comanda.html index 2e05d03..4dbf72c 100644 --- a/gestaoRaul/templates/htmx_components/comandas/htmx_list_products_in_comanda.html +++ b/gestaoRaul/templates/htmx_components/comandas/htmx_list_products_in_comanda.html @@ -1,4 +1,6 @@ {% load static %} +{% load custom_filter_tag %} +