@@ -162,27 +162,30 @@ def citation(self):
162162 title = self .full_title (),
163163 )
164164 )
165-
165+
166166 def contributors_citation (self ):
167167 contributors = self .contributor_set .all ()
168+ contributors_count = contributors .count ()
168169
169- if not contributors . exists () :
170+ if contributors_count == 0 :
170171 return ''
171172
172- if contributors . count () == 1 :
173+ if contributors_count == 1 :
173174 return '{contributor} ' .format (
174175 contributor = contributors [0 ].citation_name (),
175176 )
176- elif contributors .count () == 2 :
177- return '{contributor_one} & {contributor_two} ' .format (
178- contributor_one = contributors [0 ].citation_name (),
179- contributor_two = contributors [1 ].citation_name (),
180- )
181- else :
182- return '{contributor} et al. ' .format (
183- contributor = contributors [0 ].citation_name (),
177+
178+ if contributors_count == 2 :
179+ return '{one} & {two} ' .format (
180+ one = contributors [0 ].citation_name (),
181+ two = contributors [1 ].citation_name (),
184182 )
185183
184+ return '{contributor} et al. ' .format (
185+ contributor = contributors [0 ].citation_name (),
186+ )
187+
188+
186189 def full_title (self ):
187190 if self .prefix and self .subtitle :
188191 return "{0} {1}: {2}" .format (self .prefix , self .title , self .subtitle )
0 commit comments