From 2f12dc6a5ebd4847adf363f3ea569fb75f408234 Mon Sep 17 00:00:00 2001
From: moanos
Date: Fri, 11 Jul 2025 18:19:28 +0200
Subject: [PATCH] fix: use complete URL
---
src/fellchensammlung/models.py | 6 +++++-
.../mail/notifications/an-to-be-checked.html | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/fellchensammlung/models.py b/src/fellchensammlung/models.py
index 7fdf9da..15bd6af 100644
--- a/src/fellchensammlung/models.py
+++ b/src/fellchensammlung/models.py
@@ -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)])
diff --git a/src/fellchensammlung/templates/fellchensammlung/mail/notifications/an-to-be-checked.html b/src/fellchensammlung/templates/fellchensammlung/mail/notifications/an-to-be-checked.html
index 7c4b8a0..8563f4e 100644
--- a/src/fellchensammlung/templates/fellchensammlung/mail/notifications/an-to-be-checked.html
+++ b/src/fellchensammlung/templates/fellchensammlung/mail/notifications/an-to-be-checked.html
@@ -11,6 +11,6 @@
- {% translate 'Vermittlung anzeigen' %}
+ {% translate 'Vermittlung anzeigen' %}
{% endblock %}
\ No newline at end of file