From 9af46290fa07eeb44c06b5fcc7ecb5112d66ba9f Mon Sep 17 00:00:00 2001 From: moanos Date: Sun, 7 Apr 2024 09:06:18 +0200 Subject: [PATCH] fix: Fix member detail view --- src/fellchensammlung/models.py | 3 +-- .../templates/fellchensammlung/details/detail-member.html | 2 +- src/fellchensammlung/urls.py | 1 + src/fellchensammlung/views.py | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/fellchensammlung/models.py b/src/fellchensammlung/models.py index 6bdc095..8d43d13 100644 --- a/src/fellchensammlung/models.py +++ b/src/fellchensammlung/models.py @@ -7,6 +7,7 @@ from django.utils.translation import gettext_lazy as _ from datetime import datetime from django.dispatch import receiver from django.db.models.signals import post_save +from django.contrib.auth.models import Group from fellchensammlung.tools import misc @@ -326,5 +327,3 @@ class Member(models.Model): def get_absolute_url(self): return reverse("member-detail", args=[str(self.user.id)]) - - diff --git a/src/fellchensammlung/templates/fellchensammlung/details/detail-member.html b/src/fellchensammlung/templates/fellchensammlung/details/detail-member.html index acd0728..fabc6c3 100644 --- a/src/fellchensammlung/templates/fellchensammlung/details/detail-member.html +++ b/src/fellchensammlung/templates/fellchensammlung/details/detail-member.html @@ -1,4 +1,4 @@ -{% extends "library/base_generic.html" %} +{% extends "fellchensammlung/base_generic.html" %} {% load i18n %} {% block content %} diff --git a/src/fellchensammlung/urls.py b/src/fellchensammlung/urls.py index d0e9d2a..af482a7 100644 --- a/src/fellchensammlung/urls.py +++ b/src/fellchensammlung/urls.py @@ -32,6 +32,7 @@ urlpatterns = [ ########### ## USERS ## ########### + # ex: user/1 path("user//", views.member_detail, name="user-detail"), ] diff --git a/src/fellchensammlung/views.py b/src/fellchensammlung/views.py index 9de3512..8d6d432 100644 --- a/src/fellchensammlung/views.py +++ b/src/fellchensammlung/views.py @@ -121,8 +121,8 @@ def report_detail_success(request, report_id): return report_detail(request, report_id, form_complete=True) -def member_detail(request, user): - member = Member.objects.get(user=user) +def member_detail(request, user_id): + member = Member.objects.get(id=user_id) context = {"member": member} return render(request, 'fellchensammlung/details/detail-member.html', context=context)