Skip to content
Snippets Groups Projects
Verified Commit 5ff74e52 authored by TheJoeCoder's avatar TheJoeCoder
Browse files

Redirect and URL name fix

parent ede76c21
Branches
No related tags found
No related merge requests found
......@@ -7,5 +7,5 @@ urlpatterns = [
path("library", views.library, name='library'),
path("books/create", views.create_book, name='create_book'),
path("books/<int:book_id>", views.view_book, name='view_book'),
path("books/<int:book_id>/to_library", views.add_to_library, name='edit_book'),
path("books/<int:book_id>/to_library", views.add_to_library, name='add_to_library'),
]
\ No newline at end of file
......@@ -131,4 +131,4 @@ def add_to_library(request, book_id):
raise PermissionDenied
userbook = UserBook(book=book, user=request.user)
userbook.save()
return redirect("library")
return redirect("view_book", book_id=book_id)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment