Add code to speaker
Add unique identifier (code) to speakers within schedule JSON API to allow speakers to be identified throughout the schedule.
This commit is contained in:
parent
2d8ca5550f
commit
72b5c3ff55
2 changed files with 7 additions and 1 deletions
3
vendor/symposion/schedule/views.py
vendored
3
vendor/symposion/schedule/views.py
vendored
|
@ -222,7 +222,8 @@ def make_speaker_dict(user, speaker):
|
|||
'name': speaker.name,
|
||||
'twitter': speaker.twitter_username,
|
||||
'contact': speaker.email if has_contact_perm(user) else 'redacted',
|
||||
'picture_url': speaker_photo(None, speaker, 120)
|
||||
'picture_url': speaker_photo(None, speaker, 120),
|
||||
'code': speaker.code,
|
||||
}
|
||||
|
||||
def schedule_json(request):
|
||||
|
|
5
vendor/symposion/speakers/models.py
vendored
5
vendor/symposion/speakers/models.py
vendored
|
@ -157,3 +157,8 @@ class Speaker(models.Model):
|
|||
for p in self.copresentations.all():
|
||||
presentations.append(p)
|
||||
return presentations
|
||||
|
||||
@property
|
||||
def code(self):
|
||||
""" A unique string that identifies this speaker. """
|
||||
return f"{self.pk}"
|
||||
|
|
Loading…
Reference in a new issue