Skip to content

Commit

Permalink
Merge pull request #450 from robertatakenaka/main_fixes
Browse files Browse the repository at this point in the history
Corrige defeitos encontrados ao executar a tarefa create_or_update_issue
  • Loading branch information
robertatakenaka authored May 7, 2024
2 parents ebb61b5 + e7b8119 commit ee91039
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions journal/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
13 changes: 9 additions & 4 deletions proc/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")

Expand Down

0 comments on commit ee91039

Please sign in to comment.