fnp
/
redakcja.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix test.
[redakcja.git]
/
apps
/
catalogue
/
views.py
diff --git
a/apps/catalogue/views.py
b/apps/catalogue/views.py
index
237e4a7
..
8a96dc6
100644
(file)
--- a/
apps/catalogue/views.py
+++ b/
apps/catalogue/views.py
@@
-58,10
+58,12
@@
def user(request, username):
@active_tab('my')
@never_cache
def my(request):
@active_tab('my')
@never_cache
def my(request):
+ last_books = sorted(request.session.get("wiki_last_books", {}).items(),
+ key=lambda x: x[1]['time'], reverse=True)
+ for k, v in last_books:
+ v['time'] = datetime.fromtimestamp(v['time'])
return render(request, 'catalogue/my_page.html', {
return render(request, 'catalogue/my_page.html', {
- 'last_books': sorted(request.session.get("wiki_last_books", {}).items(),
- key=lambda x: x[1]['time'], reverse=True),
-
+ 'last_books': last_books,
"logout_to": '/',
})
"logout_to": '/',
})
@@
-142,7
+144,7
@@
def upload(request):
if request.method == "POST":
form = forms.DocumentsUploadForm(request.POST, request.FILES)
if form.is_valid():
if request.method == "POST":
form = forms.DocumentsUploadForm(request.POST, request.FILES)
if form.is_valid():
- import slughifi
+ from slugify import slugify
if request.user.is_authenticated():
creator = request.user
if request.user.is_authenticated():
creator = request.user
@@
-159,7
+161,7
@@
def upload(request):
if filename[-1] == '/':
continue
title = os.path.basename(filename)[:-4]
if filename[-1] == '/':
continue
title = os.path.basename(filename)[:-4]
- slug = slug
hifi
(title)
+ slug = slug
ify
(title)
if not (slug and filename.endswith('.xml')):
skipped_list.append(filename)
elif slug in slugs:
if not (slug and filename.endswith('.xml')):
skipped_list.append(filename)
elif slug in slugs: