From a6aa5f7b5dd74ff73765a8726080c538908750f1 Mon Sep 17 00:00:00 2001 From: Zergling_man Date: Fri, 29 Oct 2021 05:48:48 +1100 Subject: [PATCH] "int - Matches zero or any positive integer". Dirty fix. --- books/urls.py | 2 +- books/views.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/books/urls.py b/books/urls.py index 9e58d50..5f3ad79 100644 --- a/books/urls.py +++ b/books/urls.py @@ -4,5 +4,5 @@ from . import views urlpatterns=[ path('',views.index,name='bidex'), path('',views.book,name='bbook'), - path('/',views.chapter,name='bchap'), + path('/',views.chapter,name='bchap'), ] \ No newline at end of file diff --git a/books/views.py b/books/views.py index ac748c4..9b727df 100644 --- a/books/views.py +++ b/books/views.py @@ -58,5 +58,5 @@ def book(bookurl): @rerender def chapter(bookurl,chapnum): book=models.Book.objects.filter(url=bookurl)[0] - chapter=models.Chapter.objects.filter(book=book,number=chapnum)[0] + chapter=models.Chapter.objects.filter(book=book,number=int(chapnum))[0] return {'title':chapter,'content':'

Navigation buttons will come later...

\n'+chapter.contents,'date':chapter.added} \ No newline at end of file