From 9540af8aec695cdf8768ce11dae676b0db76cc06 Mon Sep 17 00:00:00 2001 From: Roberta Takenaka Date: Tue, 7 May 2024 16:16:20 -0300 Subject: [PATCH 1/2] Adiciona self. para created e updated --- journal/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/journal/models.py b/journal/models.py index 5cfbc484..407b2d9c 100644 --- a/journal/models.py +++ b/journal/models.py @@ -174,8 +174,8 @@ def data(self): issn_print=self.official_journal.issn_print, issn_electronic=self.official_journal.issn_electronic, foundation_year=self.official_journal.foundation_year, - created=created.isoformat(), - updated=updated.isoformat(), + created=self.created.isoformat(), + updated=self.updated.isoformat(), ) def autocomplete_label(self): From e7b81193da6f1c1c39443d09565978c2f7eb9ec6 Mon Sep 17 00:00:00 2001 From: Roberta Takenaka Date: Tue, 7 May 2024 16:17:09 -0300 Subject: [PATCH 2/2] =?UTF-8?q?Levanta=20exce=C3=A7=C3=A3o=20quando=20n?= =?UTF-8?q?=C3=A3o=20consegue=20obter=20journal=5Fproc=20com=20dados=20de?= =?UTF-8?q?=20issue=5Fproc.collection=20e=20classic=5Fissue.journal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- proc/controller.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/proc/controller.py b/proc/controller.py index daa504d7..cde9921d 100644 --- a/proc/controller.py +++ b/proc/controller.py @@ -74,10 +74,15 @@ def create_or_update_issue( return issue_proc.issue classic_website_issue = classic_ws.Issue(issue_proc.migrated_data.data) - journal_proc = JournalProc.get( - collection=issue_proc.collection, - pid=classic_website_issue.journal, - ) + try: + journal_proc = JournalProc.get( + collection=issue_proc.collection, + pid=classic_website_issue.journal, + ) + except JournalProc.DoesNotExist: + raise ValueError( + f"Unable to get journal_proc for issue_proc: {issue_proc}, collection: {issue_proc.collection}, pid={classic_website_issue.journal}" + ) if not journal_proc.journal: raise ValueError(f"Missing JournalProc.journal for {journal_proc}")