diff options
Diffstat (limited to 'servo')
-rw-r--r-- | servo/models/order.py | 6 | ||||
-rw-r--r-- | servo/views/checkin.py | 4 |
2 files changed, 4 insertions, 6 deletions
diff --git a/servo/models/order.py b/servo/models/order.py index ba4fed5..f163f9b 100644 --- a/servo/models/order.py +++ b/servo/models/order.py @@ -383,10 +383,10 @@ class Order(models.Model): pass def get_status_description(self): - try: + if self.status is None: + return _('Order is waiting to be processed') + else return self.status.status.description - except Exception: - pass def get_status_id(self): """ diff --git a/servo/views/checkin.py b/servo/views/checkin.py index a92d25b..66b83f8 100644 --- a/servo/views/checkin.py +++ b/servo/views/checkin.py @@ -186,13 +186,11 @@ def status(request): code = form.cleaned_data['code'] try: order = Order.objects.get(code=code) + status_description = order.get_status_description() if Configuration.conf('checkin_timeline'): timeline = order.orderstatus_set.all() if order.status is None: order.status_name = _(u'Waiting to be processed') - status_description = _('Order is waiting to be processed') - else: - status_description = order.status.status.description except Order.DoesNotExist: messages.error(request, _(u'Order %s not found') % code) return render(request, "checkin/status-show.html", locals()) |