From fe789e64232653b7a9409e788e8941d1c232d93c Mon Sep 17 00:00:00 2001 From: Art Rhyno Date: Thu, 10 Jan 2013 19:57:38 -0500 Subject: [PATCH] Fix bug in Z39.50 searching If a site had not defined EVERGREEN_OPAC_URL in settings, the Z39.50 search was tripping on it. Thanks to shadowspar for catching it. Also updated the date for the new year. Signed-off-by: Art Rhyno --- conifer/integration/evergreen_site.py | 7 +++---- conifer/templates/master.xhtml | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/conifer/integration/evergreen_site.py b/conifer/integration/evergreen_site.py index f0d8f4d..6f4b3a3 100644 --- a/conifer/integration/evergreen_site.py +++ b/conifer/integration/evergreen_site.py @@ -19,7 +19,7 @@ try: OSRF_LIB_INSTALLED = True except ImportError: OSRF_LIB_INSTALLED = False - + if OSRF_LIB_INSTALLED: from conifer.libsystems.evergreen.startup import ils_startup @@ -481,14 +481,13 @@ class EvergreenIntegration(object): # TODO: move this to local_settings LIBCODE = 'OWA' if hasattr(settings, 'EVERGREEN_LIBCODE'): - LIBCODE = settings.EVERGREEN_OPAC_URL + # LIBCODE = settings.EVERGREEN_OPAC_URL + LIBCODE = self.OPAC_URL try: dct = M.marcxml_to_dictionary(marc_string) words = lambda string: re.findall(r'\S+', string) keys = words(dct.get('8569')) urls = words(dct.get('856u')) - print 'KEYS:', keys - print 'URLS:', urls return urls[keys.index(LIBCODE)] except: return None diff --git a/conifer/templates/master.xhtml b/conifer/templates/master.xhtml index ce833dc..d65c74c 100644 --- a/conifer/templates/master.xhtml +++ b/conifer/templates/master.xhtml @@ -72,7 +72,7 @@ from django.conf import settings -- 2.11.0