diff --git a/releases/unreleased/identity-refresh-bug-for-some-items.yml b/releases/unreleased/identity-refresh-bug-for-some-items.yml new file mode 100644 index 00000000..04765d5b --- /dev/null +++ b/releases/unreleased/identity-refresh-bug-for-some-items.yml @@ -0,0 +1,12 @@ +--- +title: Identity refresh bug for some items +category: fixed +author: Jose Javier Merchante +issue: null +notes: > + Fix issue where some fields were not refreshed. + The bug occurred because the queries to OpenSearch filtered + items in which `author_uuid` was the individual pk, but not + when the `_uuid` was the individual pk. That causes many + items that contain the `_uuid` but not the `author_uuid` + not to be refreshed. diff --git a/sirmordred/task_enrich.py b/sirmordred/task_enrich.py index 4d27e755..bb107e43 100644 --- a/sirmordred/task_enrich.py +++ b/sirmordred/task_enrich.py @@ -249,12 +249,16 @@ def __autorefresh(self, enrich_backend, studies=False): next_autorefresh = self.__update_last_autorefresh() logger.debug('Getting last modified identities from SH since %s for %s', after, self.backend_section) + author_fields = ["author_uuid"] + for role in enrich_backend.roles: + author_fields.append(role + '_uuid') try: meta_fields = enrich_backend.meta_fields author_fields += meta_fields except AttributeError: pass + logger.debug("Refreshing identity ids for %s", self.backend_section) total = 0 time_start = datetime.now()