Skip to content

Commit

Permalink
Fix for #383
Browse files Browse the repository at this point in the history
  • Loading branch information
nutjob4life committed Dec 11, 2024
1 parent 4c8724c commit fc0089a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/eke.knowledge/src/eke/knowledge/publications.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,9 @@ def associate_publication(self, publication: Publication, pmids_to_sites: dict,
subject_uris = pmids_to_uris.get(publication.pubMedID, set())
existing_subject_uris = set([i for i in publication.subject_uris.all().values_list('identifier', flat=True)])
if subject_uris != existing_subject_uris:
# #383: remove existing PublicationSubjectURIs; covers the case when DMCC changes the
# pubMedID of a publication but keeps their same DMCC number (subject URI)
PublicationSubjectURI.objects.filter(identifier__in=subject_uris).delete()
modifications = True
publication.subject_uris.set([PublicationSubjectURI(identifier=i) for i in subject_uris], clear=True)

Expand Down

0 comments on commit fc0089a

Please sign in to comment.