aboutsummaryrefslogtreecommitdiffstats
path: root/servo/views/search.py
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2016-05-01 19:03:53 +0300
committerFilipp Lepalaan <filipp@mac.com>2016-05-01 19:03:53 +0300
commit82e1fe63447f5c4d33d8a3ed7c365e7eab1006c0 (patch)
treecd96c0a704cb31837c6e0b2e9affe998d24acd7b /servo/views/search.py
parentec867584ef2078492d70b555ca419ea9e01dca8e (diff)
downloadServo-82e1fe63447f5c4d33d8a3ed7c365e7eab1006c0.tar.gz
Servo-82e1fe63447f5c4d33d8a3ed7c365e7eab1006c0.tar.bz2
Servo-82e1fe63447f5c4d33d8a3ed7c365e7eab1006c0.zip
May '16 GSX update changes
Diffstat (limited to 'servo/views/search.py')
-rw-r--r--servo/views/search.py7
1 files changed, 4 insertions, 3 deletions
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)