kopia lustrzana https://gitlab.com/marnanel/chapeau
add "activity_url" property to Status, and corresponding STATUS_ACTIVITY_URL template to settings
rodzic
e9af25bc6f
commit
88bef76a14
|
@ -43,6 +43,7 @@ KEPI = {
|
|||
'USER_LINK': '/users/%(username)s',
|
||||
'COLLECTION_LINK': '/users/%(username)s/%(listname)s',
|
||||
'STATUS_LINK': '/users/%(username)s/%(id)s',
|
||||
'STATUS_ACTIVITY_LINK': '/users/%(username)s/%(id)s/activity',
|
||||
'STATUS_FEED_LINK': '/users/%(username)s/feed/%(id)s',
|
||||
'USER_FEED_LINK': '/users/%(username)s/feed',
|
||||
'USER_WEBFINGER_LINK': '/.well-known/webfinger?resource=acct:%(username)s@%(hostname)s',
|
||||
|
|
|
@ -193,6 +193,18 @@ class Status(PolymorphicModel):
|
|||
'id': self.id,
|
||||
})
|
||||
|
||||
@property
|
||||
def activity_url(self):
|
||||
if self.remote_url is not None:
|
||||
raise ValueError(
|
||||
"Activity URL is not stored for remote statuses",
|
||||
)
|
||||
|
||||
return uri_to_url(settings.KEPI['STATUS_ACTIVITY_LINK'] % {
|
||||
'username': self.account.username,
|
||||
'id': self.id,
|
||||
})
|
||||
|
||||
@property
|
||||
def ancestors(self):
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue