Skip to content
Snippets Groups Projects
Commit 187b8955 authored by Christian Dresen's avatar Christian Dresen
Browse files

[Warpfood] Remove deleting food orders if sheet is ordered

parent d80547e2
No related branches found
No related tags found
No related merge requests found
......@@ -77,7 +77,9 @@
<table class="table table-striped table-hover">
<thead>
<tr>
<th>&nbsp;&nbsp;<span class="glyphicon glyphicon-trash"></span></th>
{% if not sheet.order_time %}
<th>&nbsp;&nbsp;<span class="glyphicon glyphicon-trash"></span></th>
{% endif %}
<th>{% trans "username" %}</th>
<th>{% trans "article" %}</th>
<th>{% trans "size" %}</th>
......@@ -89,7 +91,9 @@
<tbody>
{% for order in orders %}
<tr>
<td>&nbsp;&nbsp;<a href="#" data-order-id="{{order.id}}" class="confirm_order_delete"><span class="glyphicon glyphicon-minus text-danger"></span></a></td>
{% if not sheet.order_time %}
<td>&nbsp;&nbsp;<a href="#" data-order-id="{{order.id}}" class="confirm_order_delete"><span class="glyphicon glyphicon-minus text-danger"></span></a></td>
{% endif %}
<td>{{ order.user }}</td>
<td>{{ order.article }}</td>
<td>{{ order.size }}</td>
......
......@@ -134,7 +134,9 @@ def delete_order(request, order_id=0):
try:
order = FoodOrder.objects.get(id=order_id)
sheet_id = order.sheet_id
order.delete()
if not order.sheet.order_time:
order.delete()
return redirect("/pizza/view/%s" % sheet_id)
except:
pass
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment