Skip to content
Snippets Groups Projects
Commit e52bc281 authored by Andreas Hubel's avatar Andreas Hubel
Browse files

fix(rooms-api): resolve internal url referenes in (room) links

parent ad5386b8
No related branches found
No related tags found
No related merge requests found
...@@ -5,7 +5,7 @@ from django.core.validators import URLValidator ...@@ -5,7 +5,7 @@ from django.core.validators import URLValidator
from django.db import models from django.db import models
from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_lazy as _
from core.utils import resolve_link from core.utils import resolve_internal_url, resolve_link
class Link(models.Model): class Link(models.Model):
...@@ -67,7 +67,7 @@ class Link(models.Model): ...@@ -67,7 +67,7 @@ class Link(models.Model):
'type': self.link_type, 'type': self.link_type,
'name': self.name, 'name': self.name,
'uri': self.link, 'uri': self.link,
'url': self.link, 'url': resolve_internal_url(self.link),
} }
def __str__(self) -> str: def __str__(self) -> str:
......
...@@ -511,7 +511,7 @@ class RoomLink(models.Model): ...@@ -511,7 +511,7 @@ class RoomLink(models.Model):
'type': self.link_type, 'type': self.link_type,
'name': self.name, 'name': self.name,
'uri': self.link, 'uri': self.link,
'url': self.link, # TODO rendered URL without local hub specific prefixes 'url': resolve_internal_url(self.link),
} }
def __str__(self): def __str__(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment