git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/trunk@1152
6d9bc8c9-1ec2-4278-b937-
99fde70a366f
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):
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,