From 00fe8d8ab9273d108c9de7de625cc7cae417e32a Mon Sep 17 00:00:00 2001 From: moanos Date: Thu, 8 Aug 2024 13:29:20 +0200 Subject: [PATCH] fix: owner --- src/fellchensammlung/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/fellchensammlung/views.py b/src/fellchensammlung/views.py index 1cafac5..3594144 100644 --- a/src/fellchensammlung/views.py +++ b/src/fellchensammlung/views.py @@ -163,7 +163,7 @@ def add_adoption_notice(request): if form.is_valid(): instance = form.save(commit=False) - instance.created_by = request.user + instance.owner = request.user """Search the location given in the location string and add it to the adoption notice""" location = Location.get_location_from_string(instance.location_string) instance.location = location @@ -201,6 +201,7 @@ def adoption_notice_add_animal(request, adoption_notice_id): if form.is_valid(): instance = form.save(commit=False) instance.adoption_notice_id = adoption_notice_id + instance.owner = request.user instance.save() form.save_m2m() if "save-and-add-another-animal" in request.POST: