fix: Fix member detail view

This commit is contained in:
moanos [he/him] 2024-04-07 09:06:18 +02:00
parent 3faf7d58ac
commit 9af46290fa
4 changed files with 5 additions and 5 deletions

View File

@ -7,6 +7,7 @@ from django.utils.translation import gettext_lazy as _
from datetime import datetime from datetime import datetime
from django.dispatch import receiver from django.dispatch import receiver
from django.db.models.signals import post_save from django.db.models.signals import post_save
from django.contrib.auth.models import Group
from fellchensammlung.tools import misc from fellchensammlung.tools import misc
@ -326,5 +327,3 @@ class Member(models.Model):
def get_absolute_url(self): def get_absolute_url(self):
return reverse("member-detail", args=[str(self.user.id)]) return reverse("member-detail", args=[str(self.user.id)])

View File

@ -1,4 +1,4 @@
{% extends "library/base_generic.html" %} {% extends "fellchensammlung/base_generic.html" %}
{% load i18n %} {% load i18n %}
{% block content %} {% block content %}

View File

@ -32,6 +32,7 @@ urlpatterns = [
########### ###########
## USERS ## ## USERS ##
########### ###########
# ex: user/1
path("user/<int:user_id>/", views.member_detail, name="user-detail"), path("user/<int:user_id>/", views.member_detail, name="user-detail"),
] ]

View File

@ -121,8 +121,8 @@ def report_detail_success(request, report_id):
return report_detail(request, report_id, form_complete=True) return report_detail(request, report_id, form_complete=True)
def member_detail(request, user): def member_detail(request, user_id):
member = Member.objects.get(user=user) member = Member.objects.get(id=user_id)
context = {"member": member} context = {"member": member}
return render(request, 'fellchensammlung/details/detail-member.html', context=context) return render(request, 'fellchensammlung/details/detail-member.html', context=context)