You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In views.py / def renew_book_librarian(request, pk) the loan status must be adapted when book is renewed and was not on loan before. Or better: only bookinstances must be loaded that have loan status 'o'.
The text was updated successfully, but these errors were encountered:
The design is that a librarian gets to this view from a list of books requiring renewal, so if accessed from the UI this would only ever be called for a book that is on loan. Further, the view can only be accessed by a logged in librarian, so it isn't like a random person can initiate a book renewal by doing a GET request with a non-loaned book instance id.
You are absolutely correct that a more robust design could check that only books that require renewal are loaded, but I do not think this would add anything to the user's understanding of Django or the tutorial.
In views.py / def renew_book_librarian(request, pk) the loan status must be adapted when book is renewed and was not on loan before. Or better: only bookinstances must be loaded that have loan status 'o'.
The text was updated successfully, but these errors were encountered: