Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Affiliation compliance flag #182

Closed
wants to merge 1 commit into from
Closed

Affiliation compliance flag #182

wants to merge 1 commit into from

Conversation

ErnestaP
Copy link
Contributor

@ErnestaP ErnestaP requested review from pamfilos February 20, 2024 16:49
@ErnestaP ErnestaP marked this pull request as ready for review February 20, 2024 16:49
]

operations = [
migrations.AddField(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the newly added migrations (14, 15) and run makemigration again, so there is only one file

@@ -122,6 +124,20 @@ def check_doi_registration_time(obj):
return False, "DOI not found in our system."


def check_authors_affiliation(article_id):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why pass article_id if you need to fetch whole article object, already there

def check_authors_affiliation(article_id):
try:
article = Article.objects.get(id=article_id)
authors = Author.objects.filter(article_id=article)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or why you need article if you want to filter by article_id, please clean up

if len(affiliations) < 1:
return False, "Author does not have affiliations"
return True, "Authors' affiliations are compliant"
except Article.DoesNotExist:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we shoudnt need Article.DoesNotExist, else there would be no compliance check to be initiated (should be caught from before)

@ErnestaP ErnestaP force-pushed the compliance-flag branch 2 times, most recently from 6ad9db5 to 0d76b31 Compare February 22, 2024 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants