From 37d98e8288469fc1d2df9e5589f1f94169e0c435 Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Fri, 11 Nov 2016 01:08:52 +0200 Subject: Show error message on errors --- servo/views/device.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'servo') diff --git a/servo/views/device.py b/servo/views/device.py index 2032a15..dd69414 100644 --- a/servo/views/device.py +++ b/servo/views/device.py @@ -14,7 +14,7 @@ from django.views.decorators.cache import cache_page from servo.lib.utils import paginate from servo.models import (Device, Order, Product, GsxAccount, - ServiceOrderItem, Customer,) + ServiceOrderItem, Customer,) from servo.forms.devices import DeviceForm, DeviceUploadForm, DeviceSearchForm @@ -153,6 +153,8 @@ def edit_device(request, pk=None, product_line=None, model=None): pk=device.pk, product_line=device.product_line, model=device.slug) + else: + messages.error(request, form.errors) data = prep_detail_view(request, pk, product_line, model) data['form'] = form -- cgit v1.2.3