fix: Fix link to admin interface

see https://forum.djangoproject.com/t/reverse-admin-urls/41535/2
This commit is contained in:
2025-06-23 12:24:53 +02:00
parent 7be61bc9b8
commit eda6da7f12
2 changed files with 4 additions and 3 deletions

View File

@@ -32,7 +32,7 @@
{% include "fellchensammlung/partials/partial-rescue-organization-contact.html" %}
</div>
<div class="block">
<a href="{% url org|admin_urlname:'change' org.pk %}">Admin interface</a>
<a class="button is-warning is-fullwidth" href="{% url org_meta|admin_urlname:'change' org.pk %}"><i class="fa-solid fa-tools fa-fw"></i> Admin interface</a>
</div>
</div>
<div class="column">

View File

@@ -685,9 +685,10 @@ def list_rescue_organizations(request, template='fellchensammlung/animal-shelter
def detail_view_rescue_organization(request, rescue_organization_id,
template='fellchensammlung/details/detail-rescue-organization.html'):
org = RescueOrganization.objects.get(pk=rescue_organization_id)
url = reverse("fellchensammlung_rescueorganization_change", args={"rescue_organization_id": rescue_organization_id})
org_meta = org._meta
return render(request, template,
context={"org": org, "map_center": org.position, "zoom_level": 6, "map_pins": [org]})
context={"org": org, "map_center": org.position, "zoom_level": 6, "map_pins": [org],
"org_meta": org_meta})
def export_own_profile(request):