SciPost Code Repository

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

Improve pubfrac display

parent 6df4a3c8
No related branches found
No related tags found
No related merge requests found
...@@ -129,12 +129,15 @@ class Organization(models.Model): ...@@ -129,12 +129,15 @@ class Organization(models.Model):
""" """
Return the organization's pubfraction for this publication, or the string 'Not defined'. Return the organization's pubfraction for this publication, or the string 'Not defined'.
""" """
pfs = OrgPubFraction.objects.filter(publication__doi_label=doi_label)
try: try:
return OrgPubFraction.objects.get( return pfs.get(organization=self).fraction
organization=self, except OrgPubFraction.DoesNotExist:
publication__doi_label=doi_label).fraction message = "as parent (ascribed to "
except: for child in self.children.all():
return 'Not yet defined' message += "%s: %s; " % (child, child.pubfraction_for_publication(doi_label))
return message.rpartition(';')[0] + ')'
return 'Not yet defined'
def pubfractions_in_year(self, year): def pubfractions_in_year(self, year):
""" """
......
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