diff --git a/app/forms.py b/app/forms.py index 73ff3ae..48ee503 100644 --- a/app/forms.py +++ b/app/forms.py @@ -44,7 +44,6 @@ class AnonOrderItemForm(OrderItemForm): if self.name.data is None: self.name.data = session.get('anon_name', None) - def validate(self): rv = OrderForm.validate(self) if not rv: diff --git a/app/templates/order.html b/app/templates/order.html index 2effb54..ca7f1dc 100644 --- a/app/templates/order.html +++ b/app/templates/order.html @@ -9,11 +9,13 @@

Order {{ order.id }} +
{% if order.can_close(current_user.id) -%} - Close
+ Close {% endif %}{% if courier_or_admin %} - Edit - {%- endif %}

+ Edit + {%- endif %} +
courier: {{ order.courrier.username }} {% if order.courrier == None and not current_user.is_anonymous() %} Volunteer @@ -101,14 +103,18 @@ {% block styles %} {{ super() }} - + {% endblock %} {% block scripts %} {{ super() }} - + {% endblock %} diff --git a/app/views/order.py b/app/views/order.py index 2187953..56e8138 100644 --- a/app/views/order.py +++ b/app/views/order.py @@ -106,7 +106,7 @@ def item_paid(order_id, item_id): if item.order.courrier_id == id or current_user.admin: item.paid = True db.session.commit() - flash('Paid %s by %s' % (item.product.name, item.user.username), 'success') + flash('Paid %s by %s' % (item.product.name, item.get_name()), 'success') return redirect(url_for('.order', id=order_id)) abort(404)