From: gfawcett Date: Wed, 8 Apr 2009 02:32:10 +0000 (+0000) Subject: SIP robustness tweaks, TODO and other housekeeping. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=c684856fb399d1ac350b5913e11f83f1b5c702df;p=Syrup.git SIP robustness tweaks, TODO and other housekeeping. git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/trunk@301 6d9bc8c9-1ec2-4278-b937-99fde70a366f --- diff --git a/conifer/TODO b/conifer/TODO index d68cd7a..cd4c2e4 100644 --- a/conifer/TODO +++ b/conifer/TODO @@ -2,7 +2,7 @@ CRITICAL: 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 @@ IMPORTANT: * 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. diff --git a/conifer/libsystems/sip/sipclient.py b/conifer/libsystems/sip/sipclient.py index 7b192e9..ee887f1 100644 --- a/conifer/libsystems/sip/sipclient.py +++ b/conifer/libsystems/sip/sipclient.py @@ -478,6 +478,8 @@ class SipClient(object): 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=''): diff --git a/conifer/syrup/models.py b/conifer/syrup/models.py index 6816a06..c038980 100644 --- a/conifer/syrup/models.py +++ b/conifer/syrup/models.py @@ -242,6 +242,8 @@ class Course(m.Model): 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 @@ class Item(m.Model): 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 == '': diff --git a/conifer/syrup/views.py b/conifer/syrup/views.py index d3de04c..6f8dfab 100644 --- a/conifer/syrup/views.py +++ b/conifer/syrup/views.py @@ -1269,10 +1269,14 @@ def _phys_checkout_get_patron(request): 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 @@ def _phys_checkout_do_checkout(request): 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):