Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loan_status. #87

Closed
pwormer opened this issue Jan 5, 2021 · 2 comments
Closed

Loan_status. #87

pwormer opened this issue Jan 5, 2021 · 2 comments

Comments

@pwormer
Copy link

pwormer commented Jan 5, 2021

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'.

@hamishwillee
Copy link
Collaborator

@pwormer Thanks for your comment.

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.

Does that make sense?

@hamishwillee
Copy link
Collaborator

Closing as answered and no further response from poster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants