diff --git a/.gitignore b/.gitignore index d2cd9a66..62324139 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,5 @@ templates/info/ *\.egg-info/ \.pytest_cache/ .eggs/ +pytest.ini +.test-venv diff --git a/ezidapp/management/commands/proc-crossref.py b/ezidapp/management/commands/proc-crossref.py index f2c29610..5dcb174e 100644 --- a/ezidapp/management/commands/proc-crossref.py +++ b/ezidapp/management/commands/proc-crossref.py @@ -50,6 +50,7 @@ class Command(ezidapp.management.commands.proc_base.AsyncProcessingCommand): name = __name__ setting = 'DAEMONS_CROSSREF_ENABLED' queue = ezidapp.models.async_queue.CrossrefQueue + refIdentifier = ezidapp.models.identifier.RefIdentifier def run(self): """Run async processing loop forever. @@ -307,6 +308,7 @@ def check_status(self, task_model: ezidapp.models.async_queue.CrossrefQueue): else: task_model.status = self.queue.FAILURE id_status = ezidapp.models.identifier.Identifier.CR_FAILURE + msg_str = self._oneLine(t[1]).strip() task_model.message = msg_str @@ -324,7 +326,8 @@ def check_status(self, task_model: ezidapp.models.async_queue.CrossrefQueue): assert s.startswith('success:'), f'ezid.setMetadata failed: {s}' if task_model.status in (self.queue.WARNING, self.queue.FAILURE): - u = ezidapp.models.util.getUserByPid(task_model.owner) + refOwner = ref_id.owner_id + u = ezidapp.models.util.getUserById(refOwner) if u.crossrefEmail: self._sendEmail(u.crossrefEmail, task_model) diff --git a/ezidapp/models/identifier.py b/ezidapp/models/identifier.py index b942c574..10d487c0 100644 --- a/ezidapp/models/identifier.py +++ b/ezidapp/models/identifier.py @@ -63,7 +63,8 @@ def __str__(self): f'isDOI={self.isDoi}, ' f'isDataCite={self.isDatacite}, ' f'isCrossref={self.isCrossref}, ' - f'target={self.target}' + f'target={self.target}, ' + f'ownerId={self.owner_id}' f')' )