From 20fd0256bfc2018f8f75515e894a8d9bfca00728 Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Fri, 15 Jun 2012 01:16:32 +0000 Subject: [PATCH] All forms should have a model svn: r19843 --- src/webapp/grampsdb/view/person.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/webapp/grampsdb/view/person.py b/src/webapp/grampsdb/view/person.py index 270d3ea2b..d1b6f88f3 100644 --- a/src/webapp/grampsdb/view/person.py +++ b/src/webapp/grampsdb/view/person.py @@ -243,6 +243,7 @@ def process_name(request, handle, order, action="view"): order=1, name_origin_type=NameOriginType.objects.get(val=NameOriginType._DEFAULT[0])) sf = SurnameForm(request.POST, instance=surname) + sf.model = surname elif action == "create": # make new data person = Person.objects.get(handle=handle) @@ -294,6 +295,7 @@ def process_name(request, handle, order, action="view"): nf = NameForm(request.POST, instance=oldname) nf.model = oldname sf = SurnameForm(request.POST, instance=oldsurname) + sf.model = oldsurname if nf.is_valid() and sf.is_valid(): # name.preferred and surname.primary get set False in the above is_valid() # person = pf.save() @@ -369,6 +371,7 @@ def process_person(request, context, handle, action, add_to=None): # view, edit, nf = NameFormFromPerson(request.POST, instance=name) nf.model = name sf = SurnameForm(request.POST, instance=surname) + sf.model = surname # check if valid: if nf.is_valid() and pf.is_valid() and sf.is_valid(): # name.preferred and surname.primary get set False in the above is_valid()