fnp
/
redakcja.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Reverted CM to version 0.63 with 2 patches:
[redakcja.git]
/
apps
/
api
/
handlers
/
library_handlers.py
diff --git
a/apps/api/handlers/library_handlers.py
b/apps/api/handlers/library_handlers.py
index
3c75c81
..
b726067
100644
(file)
--- a/
apps/api/handlers/library_handlers.py
+++ b/
apps/api/handlers/library_handlers.py
@@
-232,8
+232,10
@@
class DocumentHTMLHandler(BaseHandler):
return librarian.html.transform(document.data('xml'), is_file=False, parse_dublincore=False)
except (EntryNotFound, RevisionNotFound), e:
return response.EntityNotFound().django_response({
return librarian.html.transform(document.data('xml'), is_file=False, parse_dublincore=False)
except (EntryNotFound, RevisionNotFound), e:
return response.EntityNotFound().django_response({
- 'exception': type(e), 'message': e.message})
-
+ 'reason': 'not-found', 'message': e.message})
+ except librarian.ParseError, e:
+ return response.InternalError().django_response({
+ 'reason': 'xml-parse-error', 'message': e.message })
#
# Image Gallery
#
# Image Gallery
@@
-259,7
+261,7
@@
class DocumentGalleryHandler(BaseHandler):
for file in os.listdir(dirpath):
if not isinstance(file, unicode):
for file in os.listdir(dirpath):
if not isinstance(file, unicode):
- log.warn(u"File %
s is gallery %s
is not unicode. Ommiting."\
+ log.warn(u"File %
r is gallery %r
is not unicode. Ommiting."\
% (file, dirpath) )
continue
% (file, dirpath) )
continue