[open-ils-commits] r301 - in servres/trunk/conifer: . libsystems/sip syrup (gfawcett)

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Apr 7 22:32:12 EDT 2009


Author: gfawcett
Date: 2009-04-07 22:32:10 -0400 (Tue, 07 Apr 2009)
New Revision: 301

Modified:
   servres/trunk/conifer/TODO
   servres/trunk/conifer/libsystems/sip/sipclient.py
   servres/trunk/conifer/syrup/models.py
   servres/trunk/conifer/syrup/views.py
Log:
SIP robustness tweaks, TODO and other housekeeping.

Modified: servres/trunk/conifer/TODO
===================================================================
--- servres/trunk/conifer/TODO	2009-04-08 01:43:41 UTC (rev 300)
+++ servres/trunk/conifer/TODO	2009-04-08 02:32:10 UTC (rev 301)
@@ -2,7 +2,7 @@
 
 IMPORTANT:
 
-* mod_python deployment testing.
+* if someone has item checked out, show due date/time on item-about page.
 
 * does 'move to new heading' show up in the right places? Should be like 'edit'.
 
@@ -11,8 +11,6 @@
 * People should be able to register themselves into open courses.
   That is, actually become a member of them.
 
-* if someone has item checked out, show due date/time on item-about page.
-
 * Import of reserves data from Leddy voyager. Laurentian, others?
 
 * accented characters in z3950 queries seem to fail. More tests needed.

Modified: servres/trunk/conifer/libsystems/sip/sipclient.py
===================================================================
--- servres/trunk/conifer/libsystems/sip/sipclient.py	2009-04-08 01:43:41 UTC (rev 300)
+++ servres/trunk/conifer/libsystems/sip/sipclient.py	2009-04-08 02:32:10 UTC (rev 301)
@@ -478,6 +478,8 @@
         msg = self.send(PATRON_INFO,PATRON_INFO_RESP,
                         {'patron':barcode,
                          'startitem':1, 'enditem':2})
+        # fixme, this may not be the best test of okayness
+        msg['success'] = msg.get('valid_patron') == 'Y'
         return msg
 
     def checkout(self, patron, item, inst=''):

Modified: servres/trunk/conifer/syrup/models.py
===================================================================
--- servres/trunk/conifer/syrup/models.py	2009-04-08 01:43:41 UTC (rev 300)
+++ servres/trunk/conifer/syrup/models.py	2009-04-08 02:32:10 UTC (rev 301)
@@ -242,6 +242,8 @@
         return mbr.role in (u'INSTR', u'PROXY')
 
     def course_url(self, suffix=''):
+        # I'm not fond of this being here. I think I'll leave this and
+        # item_url non-implemented, and monkey-patch them in views.py.
         req = genshi_locals.get_request()
         prefix = req.META['SCRIPT_NAME']
         return '%s/course/%d/%s' % (prefix, self.id, suffix)
@@ -468,6 +470,8 @@
         return self.item_type in ('ELEC', 'URL', 'PHYS')
 
     def item_url(self, suffix='', force_local_url=False):
+        # I'm not fond of this being here. I think I'll leave this and
+        # course_url non-implemented, and monkey-patch them in views.py.
         req = genshi_locals.get_request()
         prefix = req.META['SCRIPT_NAME']
         if self.item_type == 'ELEC' and suffix == '':

Modified: servres/trunk/conifer/syrup/views.py
===================================================================
--- servres/trunk/conifer/syrup/views.py	2009-04-08 01:43:41 UTC (rev 300)
+++ servres/trunk/conifer/syrup/views.py	2009-04-08 02:32:10 UTC (rev 301)
@@ -1269,10 +1269,14 @@
     post           = lambda k: request.POST.get(k, '').strip()
     patron, item   = post('patron'), post('item')
     msg            = lib_integration.patron_info(patron)
-    patron_descrip = '%s (%s) — %s' % (
-        msg['personal'], msg['home_library'], msg['screenmsg'])
-    return g.render('phys/checkout.xhtml', step=2, 
-                    patron=patron, patron_descrip=patron_descrip)
+    if not msg['success']:
+        return simple_message(_('Invalid patron barcode'),
+                              _('No such patron could be found.'))
+    else:
+        patron_descrip = '%s (%s) — %s' % (
+            msg['personal'], msg['home_library'], msg['screenmsg'])
+        return g.render('phys/checkout.xhtml', step=2, 
+                        patron=patron, patron_descrip=patron_descrip)
 
 def _phys_checkout_do_checkout(request):
     post           = lambda k: request.POST.get(k, '').strip()
@@ -1312,7 +1316,7 @@
         return g.render('phys/checkout.xhtml', step=3, 
                         patron=patron, item=item,
                         patron_descrip=patron_descrip,
-                        checkout_result=msg,
+                        checkout_result=msg_checkout,
                         item_descrip=item_descrip)
 
 def _phys_checkout_do_another(request):



More information about the open-ils-commits mailing list