From 21da0e6ffb29a3a87bd04870a0e2c2c105ba1a1d Mon Sep 17 00:00:00 2001 From: Maximilian Moser <maximilian.moser@tuwien.ac.at> Date: Thu, 13 Feb 2025 16:55:35 +0100 Subject: [PATCH] Add "id" to the fake system entity * previously, this property was missing from the fake entity which would trip up notification builders --- CHANGES.rst | 1 + invenio_config_tuw/notifications/entity_resolvers.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 18584b2..8dbd145 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -12,6 +12,7 @@ Changes Version <next> - Allow secondary email address to be removed again +- Add "id" to the fake entity created by `SystemEntityProxy._resolve()` Version 2025.1.8 (released 2025-02-13) diff --git a/invenio_config_tuw/notifications/entity_resolvers.py b/invenio_config_tuw/notifications/entity_resolvers.py index e6fc90a..5d2c043 100644 --- a/invenio_config_tuw/notifications/entity_resolvers.py +++ b/invenio_config_tuw/notifications/entity_resolvers.py @@ -27,7 +27,11 @@ class SystemEntityProxy(EntityProxy): Since this will mostly be used in Jinja templates, it being a dictionary and not an actual object is fine. """ - return {"username": "system", "user_profile": {"full_name": "System"}} + return { + "id": "system", + "username": "system", + "user_profile": {"full_name": "System"}, + } def pick_resolved_fields(self, identity, resolved_dict): """Select which fields to return when resolving the reference.""" -- GitLab