diff options
author | Filipp Lepalaan <filipp@mac.com> | 2016-05-01 23:54:58 +0300 |
---|---|---|
committer | Filipp Lepalaan <filipp@mac.com> | 2016-05-01 23:54:58 +0300 |
commit | 47cc21441b437fe148c72bd181059728b47bdf9b (patch) | |
tree | cd96c0a704cb31837c6e0b2e9affe998d24acd7b /servo/views/search.py | |
parent | 65df597329bbb602dd382695c639aab3776123ea (diff) | |
parent | 82e1fe63447f5c4d33d8a3ed7c365e7eab1006c0 (diff) | |
download | Servo-47cc21441b437fe148c72bd181059728b47bdf9b.tar.gz Servo-47cc21441b437fe148c72bd181059728b47bdf9b.tar.bz2 Servo-47cc21441b437fe148c72bd181059728b47bdf9b.zip |
Merge branch 'develop'
Diffstat (limited to 'servo/views/search.py')
-rw-r--r-- | servo/views/search.py | 7 |
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) |