From 7620c0338c7bc9050f5eae58ce6ee5bb8cf42fc4 Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Wed, 14 Oct 2015 23:27:17 +0300 Subject: Catch GsxError in repair details --- servo/views/gsx.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'servo/views/gsx.py') diff --git a/servo/views/gsx.py b/servo/views/gsx.py index ce2ad1d..d8e1083 100644 --- a/servo/views/gsx.py +++ b/servo/views/gsx.py @@ -322,10 +322,17 @@ def repair_details(request, confirmation): """ Returns GSX repair details for confirmation number """ - repair = RepairDetails(confirmation) + try: + repair = RepairDetails(confirmation) + except Exception as e: + data = {'error': e} + return render(request, "snippets/error_modal.html", data) + data = {'repair': repair} + if request.method == "POST": data = save_repair(request, data) + return render(request, "repairs/get_details.html", data) -- cgit v1.2.3