Skip to content

Commit

Permalink
#3498 tries to find the default and when not found creates one.
Browse files Browse the repository at this point in the history
  • Loading branch information
ajrbyers authored and mauromsl committed Dec 12, 2023
1 parent 12c2335 commit a81aea4
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions ojs/importers.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,16 +261,12 @@ def import_review_data(article_dict, article, client):
article.manuscript_files.add(author_revision)

# Attempt to get the default review form
try:
form = review_models.ReviewForm.objects.filter(
journal=article.journal,
).first()
except review_models.ReviewForm.DoesNotExit:
logger.error(
'You must have at least one review form for the journal before'
' importing.'
)
raise
form = review_models.ReviewForm.objects.filter(
journal=article.journal,
).first()
if not form:
logger.info('No review form found, generating a default one.')
article.journal.setup_default_review_form()

# Set for avoiding duplicate review files
for review in article_dict.get('reviews'):
Expand Down

0 comments on commit a81aea4

Please sign in to comment.