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

notifications: fix German availability template #2083

Merged
merged 1 commit into from
Jun 29, 2021

Conversation

rerowep
Copy link
Contributor

@rerowep rerowep commented Jun 28, 2021

Co-Authored-by: Peter Weber peter.weber@rero.ch

Why are you opening this PR?

  • Which task/US does it implement?
  • Which issue does it fix?

Dependencies

My PR depends on the following rero-ils-ui's PR(s):

  • rero/rero-ils-ui#

How to test?

  • What command should I have to run to test your PR?
  • What should I test through the UI?

Code review check list

  • Commit message template compliance.
  • Commit message without typos.
  • File names.
  • Functions names.
  • Functions docstrings.
  • Unnecessary commited files?
  • Cypress tests successful?

@rerowep rerowep self-assigned this Jun 28, 2021
@iGormilhit iGormilhit changed the title notification: fix German availability template notifications: fix German availability template Jun 28, 2021
Copy link

@iGormilhit iGormilhit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit message proposition:

notifications: fix German availability template

* Fixes the display of the next opened day of the library.

In the title, notifications with an 's'.

@rerowep rerowep force-pushed the wep-fix-ger-availability-notification branch from fbbeb43 to 4ea5878 Compare June 28, 2021 07:55
@rerowep rerowep requested review from zannkukai and iGormilhit June 28, 2021 07:56
Copy link
Contributor

@zannkukai zannkukai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure ? For me the problem seems to be in other templates.
We're teellng that a book is available at a "pickup_location", it seems normal to use this "pickup_location" to determine the next_open

@rerowep
Copy link
Contributor Author

rerowep commented Jun 28, 2021

Are you sure ? For me the problem seems to be in other templates.
We're teellng that a book is available at a "pickup_location", it seems normal to use this "pickup_location" to determine the next_open

If I understand the code right, the library is the pickup_location:

            if pickup_location:
                data['loan']['pickup_location'] = \
                    pickup_location.replace_refs().dumps()
                # del(data['loan']['pickup_location_pid'])
                library_pid = data['loan']['pickup_location']['library']['pid']
                library = Library.get_record_by_pid(library_pid)
                data['loan']['pickup_name'] = pickup_location['pickup_name']
                data['loan']['library'] = library
                # TODO: make availability days variable (fixed to 10 days)
                keep_until = datetime.now(timezone.utc) + timedelta(days=10)
                next_open = library.next_open(keep_until)
                # language = data['loan']['patron']['communication_language']
                next_open = next_open.strftime("%d.%m.%Y")
                data['loan']['library']['next_open'] = next_open

* Fixes the display of the next opened day of the library.

Co-Authored-by: Peter Weber <peter.weber@rero.ch>
@rerowep rerowep force-pushed the wep-fix-ger-availability-notification branch from 4ea5878 to 8927047 Compare June 28, 2021 11:32
@rerowep rerowep merged commit 3660656 into rero:dev Jun 29, 2021
@rerowep rerowep deleted the wep-fix-ger-availability-notification branch June 29, 2021 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants