Protection for names with no primary name set

svn: r19397
This commit is contained in:
Doug Blank 2012-04-28 20:36:00 +00:00
parent 73a37df305
commit 24ac90fde9

View File

@ -521,8 +521,12 @@ def view_person_detail(request, view, handle, action="view"):
return fix_person(request, person)
pf = PersonForm(instance=person)
pf.model = person
primary = name.surname_set.get(primary=True)
nf = NameForm(instance=name)
try:
primary = name.surname_set.get(primary=True)
except:
primary = Surname()
primary.name = name
nf.prefix=primary.prefix
nf.surname=primary.surname
nf.origin=primary.name_origin_type