[open-ils-commits] r1152 - servres/trunk/conifer/syrup/views (gfawcett)

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Dec 29 14:45:33 EST 2010


Author: gfawcett
Date: 2010-12-29 14:45:28 -0500 (Wed, 29 Dec 2010)
New Revision: 1152

Modified:
   servres/trunk/conifer/syrup/views/_common.py
   servres/trunk/conifer/syrup/views/items.py
Log:
slightly better error on missing title/url on URL item.

Modified: servres/trunk/conifer/syrup/views/_common.py
===================================================================
--- servres/trunk/conifer/syrup/views/_common.py	2010-12-29 19:34:10 UTC (rev 1151)
+++ servres/trunk/conifer/syrup/views/_common.py	2010-12-29 19:45:28 UTC (rev 1152)
@@ -124,8 +124,12 @@
 
 def custom_500_handler(request):
     cls, inst, tb = sys.exc_info()
+    if settings.DEBUG:
+        body = repr((request.__dict__, inst))
+    else:
+        body = ''
     msg = simple_message(_('Error: %s') % repr(inst),
-                         repr((request.__dict__, inst)))
+                         body)
     return HttpResponse(msg._container, status=501)
 
 def custom_400_handler(request):

Modified: servres/trunk/conifer/syrup/views/items.py
===================================================================
--- servres/trunk/conifer/syrup/views/items.py	2010-12-29 19:34:10 UTC (rev 1151)
+++ servres/trunk/conifer/syrup/views/items.py	2010-12-29 19:45:28 UTC (rev 1152)
@@ -154,9 +154,7 @@
             publisher = clean('publisher')
             published = clean('published')
             if not (title and url):
-                raise Exception(locals())
-                # fixme, better error handling.
-                return HttpResponseRedirect(request.get_full_path())
+                raise Exception('Missing title and/or URL.')
             else:
                 item = models.Item(
                     site=site,



More information about the open-ils-commits mailing list