fnp
/
redakcja.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix
[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
9d50d02
..
0f5b6d6
100644
(file)
--- a/
apps/api/handlers/library_handlers.py
+++ b/
apps/api/handlers/library_handlers.py
@@
-60,8
+60,7
@@
class LibraryHandler(BaseHandler):
documents = {}
documents = {}
- for docid in lib.documents():
- docid = docid.decode('utf-8')
+ for docid in lib.documents():
documents[docid] = {
'url': reverse('document_view', args=[docid]),
'name': docid,
documents[docid] = {
'url': reverse('document_view', args=[docid]),
'name': docid,
@@
-238,7
+237,6
@@
class DocumentHTMLHandler(BaseHandler):
#
# Image Gallery
#
#
# Image Gallery
#
-from django.core.files.storage import FileSystemStorage
class DocumentGalleryHandler(BaseHandler):
allowed_methods = ('GET')
class DocumentGalleryHandler(BaseHandler):
allowed_methods = ('GET')
@@
-256,7
+254,9
@@
class DocumentGalleryHandler(BaseHandler):
gallery = {'name': assoc.name, 'pages': []}
gallery = {'name': assoc.name, 'pages': []}
- for file in sorted(os.listdir(dirpath), key=natural_order()):
+ for file in sorted( os.listdir(dirpath) ):
+ file = file.encode('utf-8')
+
log.info(file)
name, ext = os.path.splitext(os.path.basename(file))
log.info(file)
name, ext = os.path.splitext(os.path.basename(file))