8000 library: detect changes on library open hours by zannkukai · Pull Request #3367 · rero/rero-ils · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Merged
merged 1 commit into from
Jun 28, 2023

Conversation

zannkukai
Copy link
Contributor

@github-actions github-actions bot added the f: circulation Concerns the circulation interface or backend label Jun 8, 2023
@zannkukai zannkukai force-pushed the zan-exception-dates branch 3 times, most recently from b545087 to a85497e Compare June 9, 2023 12:12
@zannkukai zannkukai self-assigned this Jun 12, 2023
@zannkukai zannkukai requested review from rerowep, jma and lauren-d June 12, 2023 12:28
@zannkukai zannkukai marked this pull request as ready for review June 12, 2023 12:54
@zannkukai zannkukai force-pushed the zan-exception-dates branch from a85497e to cdad917 Compare June 15, 2023 14:09
active_loan_counter += 1
if not library.is_open(loan.end_date):
loan['end_date'] = library \
.next_open(loan.end_date) \
Copy link
Contributor

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?

@zannkukai zannkukai force-pushed the zan-exception-dates branch from cdad917 to 90e8043 Compare June 21, 2023 14:48
* 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>
@zannkukai zannkukai force-pushed the zan-exception-dates branch from 90e8043 to 7ec7808 Compare June 22, 2023 12:58
@zannkukai zannkukai merged commit 3a18258 into rero:staging Jun 28, 2023
@zannkukai zannkukai deleted the zan-exception-dates branch June 28, 2023 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
f: circulation Concerns the circulation interface or backend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update loans end_date when a closed date/period is added into library exceptions
5 participants
0