diff options
Diffstat (limited to 'servo/views')
-rw-r--r-- | servo/views/api.py | 2 | ||||
-rw-r--r-- | servo/views/order.py | 2 | ||||
-rw-r--r-- | servo/views/search.py | 7 |
3 files changed, 6 insertions, 5 deletions
diff --git a/servo/views/api.py b/servo/views/api.py index 9d2ba76..c8253bc 100644 --- a/servo/views/api.py +++ b/servo/views/api.py @@ -309,7 +309,7 @@ def warranty(request): try: GsxAccount.default(request.user) except Exception as e: - return error('Cannot connect to GSX (check user name and password)') + return error('Cannot connect to GSX (check username and password)') try: result = Device.from_gsx(sn, cached=False) diff --git a/servo/views/order.py b/servo/views/order.py index b4838f7..2ae34a1 100644 --- a/servo/views/order.py +++ b/servo/views/order.py @@ -631,7 +631,7 @@ def device_from_product(request, pk, item_id): try: GsxAccount.default(request.user, order.queue) - device = Device.from_gsx(soi.sn) + device = Device.from_gsx(soi.sn, user=request.user) device.save() event = order.add_device(device, request.user) messages.success(request, event) diff --git a/servo/views/search.py b/servo/views/search.py index 7640839..43f840f 100644 --- a/servo/views/search.py +++ b/servo/views/search.py @@ -21,6 +21,7 @@ from servo.models import (Note, Device, Product, def search_gsx(request, what, param, query): """ The first phase of a GSX search. Sets up the GSX connection. + @TODO: Should this be in Device.from_gsx()? """ title = _(u'Search results for "%s"') % query @@ -62,13 +63,13 @@ def get_gsx_search_results(request, what, param, query): return render(request, "orders/list.html", locals()) if what == "warranty": - # Update wty info if been here before + # Update wty info if device has been serviced before try: device = Device.objects.get(sn__exact=query) device.update_gsx_details() except Exception: try: - device = Device.from_gsx(query) + device = Device.from_gsx(query, user=request.user) except Exception as e: return render(request, error_template, {'message': e}) @@ -117,11 +118,11 @@ def get_gsx_search_results(request, what, param, query): try: device = gsxws.Product(query) #results = device.repairs() - # @TODO: move the encoding hack to py-gsxws for i, p in enumerate(device.repairs()): d = {'purchaseOrderNumber': p.purchaseOrderNumber} d['repairConfirmationNumber'] = p.repairConfirmationNumber d['createdOn'] = p.createdOn + # @TODO: move the encoding hack to py-gsxws d['customerName'] = p.customerName.encode('utf-8') d['repairStatus'] = p.repairStatus results.append(d) |