Commit f6bd4290 authored by Dmitry Shelepnev's avatar Dmitry Shelepnev
Browse files

Test nofooter

parent 99ced23c
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -13,16 +13,16 @@ def sopds_processor(request):
    args['sopds_auth']=AUTH
    args['sopds_version']=VERSION
    user=request.user
    if user.is_authenticated():
        result=[]
        for i,row in enumerate(bookshelf.objects.filter(user=user).order_by('-readtime')[:8]):
            book = Book.objects.get(id=row.book_id)
            p = {'id':row.id, 'readtime': row.readtime, 'book_id': row.book_id, 'title': book.title, 'authors':book.authors.values()}       
            result.append(p)    
        args['bookshelf']=result
        
        random_book = Book.objects.all().order_by('?')[:1].get()
        args['random_book'] = random_book
#    if user.is_authenticated():
#        result=[]
#        for i,row in enumerate(bookshelf.objects.filter(user=user).order_by('-readtime')[:8]):
#            book = Book.objects.get(id=row.book_id)
#            p = {'id':row.id, 'readtime': row.readtime, 'book_id': row.book_id, 'title': book.title, 'authors':book.authors.values()}       
#            result.append(p)    
#        args['bookshelf']=result
#        
#        random_book = Book.objects.all().order_by('?')[:1].get()
#        args['random_book'] = random_book
        
    return args