@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', {
- 'last_books': sorted(request.session.get("wiki_last_books", {}).items(),
- key=lambda x: x[1]['time'], reverse=True),
-
+ 'last_books': last_books,
"logout_to": '/',
})
if request.method == "POST":
form = forms.DocumentsUploadForm(request.POST, request.FILES)
if form.is_valid():
- from fnpdjango.utils.text.slughifi import slughifi
+ from slugify import slugify
if request.user.is_authenticated():
creator = request.user
if filename[-1] == '/':
continue
title = os.path.basename(filename)[:-4]
- slug = slughifi(title)
+ slug = slugify(title)
if not (slug and filename.endswith('.xml')):
skipped_list.append(filename)
elif slug in slugs: