"int - Matches zero or any positive integer". Dirty fix.

This commit is contained in:
Zergling_man 2021-10-29 05:48:48 +11:00
parent a403aa7375
commit a6aa5f7b5d
2 changed files with 2 additions and 2 deletions

View File

@ -4,5 +4,5 @@ from . import views
urlpatterns=[
path('',views.index,name='bidex'),
path('<str:bookurl>',views.book,name='bbook'),
path('<str:bookurl>/<int:chapnum>',views.chapter,name='bchap'),
path('<str:bookurl>/<str:chapnum>',views.chapter,name='bchap'),
]

View File

@ -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':'<p>Navigation buttons will come later...</p>\n'+chapter.contents,'date':chapter.added}