-
Notifications
You must be signed in to change notification settings - Fork 7
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
Conversation
ErnestaP
commented
Feb 20, 2024
- compliance: flag on incomplete author cern-sis/issues-scoap3#295
] | ||
|
||
operations = [ | ||
migrations.AddField( |
There was a problem hiding this comment.
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
edc4796
to
8ddf4e0
Compare
scoap3/articles/tasks.py
Outdated
@@ -122,6 +124,20 @@ def check_doi_registration_time(obj): | |||
return False, "DOI not found in our system." | |||
|
|||
|
|||
def check_authors_affiliation(article_id): |
There was a problem hiding this comment.
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
scoap3/articles/tasks.py
Outdated
def check_authors_affiliation(article_id): | ||
try: | ||
article = Article.objects.get(id=article_id) | ||
authors = Author.objects.filter(article_id=article) |
There was a problem hiding this comment.
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
scoap3/articles/tasks.py
Outdated
if len(affiliations) < 1: | ||
return False, "Author does not have affiliations" | ||
return True, "Authors' affiliations are compliant" | ||
except Article.DoesNotExist: |
There was a problem hiding this comment.
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)
6ad9db5
to
0d76b31
Compare
0d76b31
to
c784a1b
Compare