Skip to content

Commit

Permalink
minor code layout tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-jones committed Aug 4, 2023
1 parent 900ecf7 commit e313ee5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions portality/bll/services/article.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def _validate_issns(article_bibjson: models.ArticleBibJSON):
def create_article(self, article, account, duplicate_check=True, merge_duplicate=True,
limit_to_account=True, add_journal_info=False, dry_run=False, update_article_id=None):

"""# no need to check eissn, if pissn matches, pissn and eissn are different and only 1 journal has been found - then eissn matches too
"""
Create an individual article in the database
This method will check and merge any duplicates, and report back on successes and failures in a manner consistent with
Expand Down Expand Up @@ -249,7 +249,8 @@ def has_permissions(self, account, article, limit_to_account):
def is_acceptable(self, article: models.Article):
"""
conduct some deep validation on the article to make sure we will accept it
or the moment, this just means making sure it has a DOI and a fulltext
this just means making sure it has a DOI and a fulltext, and that its ISSNs
match a single journal
"""
try:
bj = article.bibjson()
Expand All @@ -266,7 +267,6 @@ def is_acceptable(self, article: models.Article):
journal = self.match_journal_with_validation(bj)

# is journal in doaj (we do this check last as it has more performance impact)
# journal = article.get_journal()
if journal is None or not journal.is_in_doaj():
raise exceptions.ArticleNotAcceptable(message=Messages.EXCEPTION_ADDING_ARTICLE_TO_WITHDRAWN_JOURNAL)

Expand Down Expand Up @@ -296,6 +296,7 @@ def match_journal_with_validation(article_bibjson: models.ArticleBibJSON):
raise exceptions.ArticleNotAcceptable(message=Messages.EXCEPTION_MISMATCHED_ISSNS)

return journal[0]

@staticmethod
def is_legitimate_owner(article, owner):
"""
Expand Down

0 comments on commit e313ee5

Please sign in to comment.