mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 17:29:17 +02:00
Fixed attachments URL not honoring media URL
This commit is contained in:
parent
975e281d15
commit
96086df156
2 changed files with 13 additions and 2 deletions
|
@ -256,14 +256,14 @@ class Attachment(models.Model):
|
|||
@property
|
||||
def download_url_original(self):
|
||||
if self.file:
|
||||
return federation_utils.full_url(self.file.url)
|
||||
return utils.media_url(self.file.url)
|
||||
proxy_url = reverse("api:v1:attachments-proxy", kwargs={"uuid": self.uuid})
|
||||
return federation_utils.full_url(proxy_url + "?next=original")
|
||||
|
||||
@property
|
||||
def download_url_medium_square_crop(self):
|
||||
if self.file:
|
||||
return federation_utils.full_url(self.file.crop["200x200"].url)
|
||||
return utils.media_url(self.file.crop["200x200"].url)
|
||||
proxy_url = reverse("api:v1:attachments-proxy", kwargs={"uuid": self.uuid})
|
||||
return federation_utils.full_url(proxy_url + "?next=medium_square_crop")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue