Skip to content

Commit

Permalink
notification: fix patron profile URL
Browse files Browse the repository at this point in the history
Closes rero#2282.

Co-Authored-by: Renaud Michotte <renaud.michotte@gmail.com>
  • Loading branch information
zannkukai committed Aug 17, 2021
1 parent 718b6eb commit 9df3b86
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions rero_ils/modules/notifications/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

from __future__ import absolute_import, print_function

import urllib.parse
from copy import deepcopy
from datetime import datetime, timedelta, timezone
from functools import partial
Expand Down Expand Up @@ -187,12 +188,12 @@ def replace_pids_and_refs(self):
patron = Patron.get_record_by_pid(data['loan']['patron']['pid'])
view_code = patron.get_organisation().get('code')
base_url = current_app.config.get('RERO_ILS_APP_URL')
profile_url = f'{base_url}/{view_code}/patrons/profile'
next_page_url = urllib.parse.quote(f'{view_code}/patrons/profile')
profile_url = f'{base_url}/signin/?next={next_page_url}'
data['loan']['profile_url'] = profile_url

return data
except Exception as error:
raise(error)
raise error

def init_loan(self):
"""Set loan of the notification."""
Expand Down

0 comments on commit 9df3b86

Please sign in to comment.