fix: use complete URL
This commit is contained in:
		@@ -14,7 +14,7 @@ from django.contrib.auth.models import AbstractUser
 | 
				
			|||||||
from django.core.exceptions import ValidationError
 | 
					from django.core.exceptions import ValidationError
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from .tools import misc, geo
 | 
					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.geo import LocationProxy, Position
 | 
				
			||||||
from .tools.misc import age_as_hr_string, time_since_as_hr_string
 | 
					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."""
 | 
					        """Returns the url to access a detailed page for the adoption notice."""
 | 
				
			||||||
        return reverse('adoption-notice-detail', args=[str(self.id)])
 | 
					        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):
 | 
					    def get_report_url(self):
 | 
				
			||||||
        """Returns the url to report an adoption notice."""
 | 
					        """Returns the url to report an adoption notice."""
 | 
				
			||||||
        return reverse('report-adoption-notice', args=[str(self.id)])
 | 
					        return reverse('report-adoption-notice', args=[str(self.id)])
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -11,6 +11,6 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    </p>
 | 
					    </p>
 | 
				
			||||||
    <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>
 | 
					    </p>
 | 
				
			||||||
{% endblock %}
 | 
					{% endblock %}
 | 
				
			||||||
		Reference in New Issue
	
	Block a user