-
Notifications
You must be signed in to change notification settings - Fork 25
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: update request pickup location #935
Conversation
b2291b2
to
b0ac996
Compare
It is also good to get the coverage to green if possible. |
b0ac996
to
fce5a9f
Compare
d04540d
to
6c05a06
Compare
6c05a06
to
e706fed
Compare
e706fed
to
9cdb57d
Compare
loan = Loan.get_record_by_pid(loan_pid) | ||
loan['pickup_location_pid'] = pickup_location_pid | ||
if not loan.get('state') == 'PENDING': | ||
return jsonify({'status': 'error: Forbidden'}), 403 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a bad request not a forbidden
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If loan state is not pending, updating pickup location is not allowed. That's why I use a 403 error message as response, because I check that the state chart is followed. Later, more complex cases will be managed and this part of the function will be modified.
https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#4xx_Client_errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If loan state is not pending, updating pickup location is not allowed. That's why I use a 403 error message as response, because I check that the state chart is followed. Later, more complex cases will be managed and this part of the function will be modified.
You are right.
* Adds route to update request pickup location. Co-Authored-by: Alicia Zangger <alicia.zangger@rero.ch>
9cdb57d
to
bb976aa
Compare
Co-Authored-by: Alicia Zangger alicia.zangger@rero.ch
Why are you opening this PR?
https://tree.taiga.io/project/rero21-reroils/task/1438?kanban-status=1224895
Task 1438 of US 1355 - cancel and edit a request
How to test?
Please do code review. It should be tested with rero/rero-ils-ui#229
Code review check list