From a1b287641d150fc95ebd89262f2b3986dc638bab Mon Sep 17 00:00:00 2001 From: moanos Date: Sat, 8 Jun 2024 11:43:55 +0200 Subject: [PATCH] feat: Add user to AN automatically --- src/fellchensammlung/views.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/fellchensammlung/views.py b/src/fellchensammlung/views.py index f5dd89d..cda779e 100644 --- a/src/fellchensammlung/views.py +++ b/src/fellchensammlung/views.py @@ -118,10 +118,9 @@ def add_adoption_notice(request): form = AdoptionNoticeForm(request.POST, request.FILES, in_adoption_notice_creation_flow=True) if form.is_valid(): - instance = form.save() - + instance = form.save(commit=False) + instance.created_by = request.user """Search the location given in the location string and add it to the adoption notice""" - geo_api = GeoAPI() location = Location.get_location_from_string(instance.location_string) instance.location = location instance.save()