From 4ffc7604c608812c132e64249771c88952a030a3 Mon Sep 17 00:00:00 2001 From: moanos Date: Thu, 30 May 2024 16:38:55 +0200 Subject: [PATCH] fix: Prevent creating a new object by passing instance --- src/fellchensammlung/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fellchensammlung/views.py b/src/fellchensammlung/views.py index 2e570d7..11dbc20 100644 --- a/src/fellchensammlung/views.py +++ b/src/fellchensammlung/views.py @@ -67,7 +67,7 @@ def adoption_notice_edit(request, adoption_notice_id): """ adoption_notice = AdoptionNotice.objects.get(pk=adoption_notice_id) if request.method == 'POST': - form = AdoptionNoticeForm(request.POST) + form = AdoptionNoticeForm(request.POST, instance=adoption_notice) if form.is_valid(): adoption_notice_instance = form.save()