Handle edge cases where a speaker has 0 events
This commit is contained in:
parent
1739297caf
commit
09cf137aac
|
@ -478,8 +478,8 @@ class SpeakerProposal(UserSubmittedModel):
|
||||||
@property
|
@property
|
||||||
def title(self):
|
def title(self):
|
||||||
""" Convenience method to return the proper host_title """
|
""" Convenience method to return the proper host_title """
|
||||||
if self.event_proposals.values_list("event_type").distinct().count() > 1:
|
if self.event_proposals.values_list("event_type").distinct().count() != 1:
|
||||||
# we have different eventtypes, use generic title
|
# we have no events, or events of different eventtypes, use generic title
|
||||||
return "Person"
|
return "Person"
|
||||||
else:
|
else:
|
||||||
return self.event_proposals.first().event_type.host_title
|
return self.event_proposals.first().event_type.host_title
|
||||||
|
|
Loading…
Reference in a new issue