fix: use complete URL

This commit is contained in:
2025-07-11 18:19:28 +02:00
parent 4b3286f12d
commit 2f12dc6a5e
2 changed files with 6 additions and 2 deletions

View File

@@ -14,7 +14,7 @@ from django.contrib.auth.models import AbstractUser
from django.core.exceptions import ValidationError
from .tools import misc, geo
from notfellchen.settings import MEDIA_URL
from notfellchen.settings import MEDIA_URL, base_url
from .tools.geo import LocationProxy, Position
from .tools.misc import age_as_hr_string, time_since_as_hr_string
@@ -389,6 +389,10 @@ class AdoptionNotice(models.Model):
"""Returns the url to access a detailed page for the adoption notice."""
return reverse('adoption-notice-detail', args=[str(self.id)])
def get_full_url(self):
"""Returns the url including protocol and domain"""
return f"{base_url}{self.get_absolute_url()}"
def get_report_url(self):
"""Returns the url to report an adoption notice."""
return reverse('report-adoption-notice', args=[str(self.id)])

View File

@@ -11,6 +11,6 @@
</p>
<p>
<a href="{{ notification.adoption_notice.get_absolute_url }}" class="cta-button">{% translate 'Vermittlung anzeigen' %}</a>
<a href="{{ notification.adoption_notice.get_full_url }}" class="cta-button">{% translate 'Vermittlung anzeigen' %}</a>
</p>
{% endblock %}