From a0a2ec990cf9cca190b4d1fbeee91fee165a7234 Mon Sep 17 00:00:00 2001 From: Bertrand Zuchuat Date: Mon, 7 Feb 2022 10:50:53 +0100 Subject: [PATCH] interface: keep the viewcode in the urls The change of the user's data as well as the change of the password has been transferred to the Angular user profile. * Removes the "edit my profile" menu entry. * Removes the "Change password" menu entry. * Closes #2000. * Closes #2195. Co-Authored-by: Bertrand Zuchuat --- pyproject.toml | 2 +- rero_ils/config.py | 12 ++++++ .../templates/rero_ils/ill_request_form.html | 2 +- rero_ils/modules/ill_requests/views.py | 12 +++--- .../templates/rero_ils/patron_profile.html | 2 +- rero_ils/modules/patrons/views.py | 18 +++++---- rero_ils/modules/users/views.py | 34 +++++++++++++--- rero_ils/theme/menus.py | 39 ++++++------------- tests/api/users/test_users_rest.py | 32 +++++++++++---- tests/ui/ill_requests/test_ill_requests_ui.py | 3 +- 10 files changed, 99 insertions(+), 57 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 179d215dd5..8093ffb467 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -61,7 +61,7 @@ redisbeat = "*" jsonpickle = ">=1.4.1" ciso8601 = "*" # TODO: to be removed when the thumbnail will be refactored -invenio-userprofiles = {git = "https://github.com/rero/invenio-userprofiles.git", rev = "v1.2.1-rero1.0"} +invenio-userprofiles = {git = "https://github.com/rero/invenio-userprofiles.git", hash = "41d2b471cde1a93f660ba7bf0037ee3fb80b65fc"} ## Additionnal constraints on python modules flask-wiki = {git = "https://github.com/rero/flask-wiki.git", tag = "v0.0.1"} diff --git a/rero_ils/config.py b/rero_ils/config.py index 362a5c5f40..a4ed0a7668 100644 --- a/rero_ils/config.py +++ b/rero_ils/config.py @@ -257,6 +257,18 @@ def _(x): #: proxies) removes these headers again before sending the response to the #: client. Set to False, in case of doubt. ACCOUNTS_USERINFO_HEADERS = False + +#: User profile +RERO_PUBLIC_USERPROFILES_READONLY = False +RERO_PUBLIC_USERPROFILES_READONLY_FIELDS = [ + 'first_name', + 'last_name', + 'birth_date' +] + +#: USER PROFILES +USERPROFILES_READ_ONLY = False; + # Disable User Profiles USERPROFILES = True USERPROFILES_COUNTRIES = get_profile_countries diff --git a/rero_ils/modules/ill_requests/templates/rero_ils/ill_request_form.html b/rero_ils/modules/ill_requests/templates/rero_ils/ill_request_form.html index fcf3f59b10..55651a03e1 100644 --- a/rero_ils/modules/ill_requests/templates/rero_ils/ill_request_form.html +++ b/rero_ils/modules/ill_requests/templates/rero_ils/ill_request_form.html @@ -27,7 +27,7 @@

{{ _('Caution!') }}

{{ _('A well detailed request is more likely to be satisfied') }}

-
+ {{ form.hidden_tag() }} {%- if form.csrf_token and form.csrf_token.errors %}