Adds chair() method to sessions so that templates can easily determine who the chair is.
This commit is contained in:
parent
b783901e98
commit
34e250322c
1 changed files with 6 additions and 0 deletions
|
@ -270,6 +270,12 @@ class Session(models.Model):
|
|||
else:
|
||||
return None
|
||||
|
||||
def chair(self):
|
||||
for role in self.sessionrole_set.all():
|
||||
if role.role == SessionRole.SESSION_ROLE_CHAIR:
|
||||
return role
|
||||
return None
|
||||
|
||||
def __str__(self):
|
||||
start = self.start()
|
||||
end = self.end()
|
||||
|
|
Loading…
Reference in a new issue