-
Notifications
You must be signed in to change notification settings - Fork 26
library: detect changes on library open hours #3367
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
Conversation
b545087
to
a85497e
Compare
a85497e
to
cdad917
Compare
rero_ils/modules/libraries/tasks.py
Outdated
active_loan_counter += 1 | ||
if not library.is_open(loan.end_date): | ||
loan['end_date'] = library \ | ||
.next_open(loan.end_date) \ |
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.
In the unlikely case where a library has no standard opening_hours and we created an exception open date in the past, next_open is going to get stuck in an infinite while loop.
With PR #3375, it will raise a LibraryNeverOpen exception. Maybe take this into account for added robustness?
cdad917
to
90e8043
Compare
* Creates extension to detect any changes into library calendar (regular hours & exception dates). If changes are detected, run this extension starts a tasks to update related loans. * Creates a task to update loans related a library if calendar changes. * Closes rero#2663. Co-Authored-by: Renaud Michotte <renaud.michotte@gmail.com>
90e8043
to
7ec7808
Compare
end_date
when a closed date/period is added into library exceptions #2663.