API refinements for activity stream

This commit is contained in:
Eliot Berriot 2018-03-01 23:41:51 +01:00
parent d509c090d3
commit a6da10be41
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
12 changed files with 188 additions and 12 deletions

View file

@ -25,3 +25,8 @@ class Listening(models.Model):
raise ValidationError('Cannot have both session_key and user empty for listening')
super().save(**kwargs)
def get_activity_url(self):
return '{}/listenings/tracks/{}'.format(
self.user.get_activity_url(), self.pk)