Changeset - 72b5c3ff556d
[Not reviewed]
0 2 0
Joel Addison - 2 years ago 2021-11-28 11:41:45
joel@addison.net.au
Add code to speaker

Add unique identifier (code) to speakers within schedule JSON API
to allow speakers to be identified throughout the schedule.
2 files changed with 7 insertions and 1 deletions:
0 comments (0 inline, 0 general)
vendor/symposion/schedule/views.py
Show inline comments
...
 
@@ -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):
vendor/symposion/speakers/models.py
Show inline comments
...
 
@@ -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}"
0 comments (0 inline, 0 general)