SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit e7ef0cca authored by Jean-Sébastien Caux's avatar Jean-Sébastien Caux
Browse files

Improve selection of Profiles for COI checks on arXiv

parent 2f3fc9b9
No related branches found
No related tags found
No related merge requests found
...@@ -33,14 +33,17 @@ class Command(BaseCommand): ...@@ -33,14 +33,17 @@ class Command(BaseCommand):
fellow_profiles = Profile.objects.filter(contributor__fellowships__id__in=fellow_ids) fellow_profiles = Profile.objects.filter(contributor__fellowships__id__in=fellow_ids)
# Get all possibly relevant Profiles # Get all possibly relevant Profiles
author_str_list = [a.split()[-1] for a in sub.author_list.split(',')] # Assume the author list is purely comma-separated,
if 'entries' in sub.metadata: # with entries in format [firstname or initial[.]] lastname
author_str_list += [ author_profile_ids = []
a['name'].split()[-1] for a in sub.metadata['entries'][0]['authors']] for a in sub.author_list.split(','):
author_str_list = set(author_str_list) # Distinct operator last = a.split()[-1]
author_profiles = Profile.objects.filter( first = a.split()[0].split('.')[0]
Q(contributor__in=sub.authors.all()) | print("%s %s" % (first, last))
Q(last_name__in=author_str_list)).distinct() author_profile_ids += [p.id for p in Profile.objects.filter(
last_name__endswith=last, first_name__startswith=first).all()]
author_profile_ids_set = set(author_profile_ids)
author_profiles = Profile.objects.filter(pk__in=author_profile_ids_set)
n_new_conflicts += caller.compare(author_profiles, fellow_profiles, submission=sub) n_new_conflicts += caller.compare(author_profiles, fellow_profiles, submission=sub)
Submission.objects.filter(id=sub.id).update(needs_conflicts_update=False) Submission.objects.filter(id=sub.id).update(needs_conflicts_update=False)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment