Working on names

svn: r18382
This commit is contained in:
Doug Blank 2011-10-29 13:58:41 +00:00
parent c76da10e9d
commit 4109dbf95e
2 changed files with 6 additions and 3 deletions

View File

@ -439,8 +439,8 @@ def view_person_detail(request, view, handle, action="view"):
except: except:
name = Name(person=person, preferred=True) name = Name(person=person, preferred=True)
primary_surname = name.surname_set.get(primary=True) primary_surname = name.surname_set.get(primary=True)
default_data = {"surname": primary_surname.surname, default_data = {"surname": "XX" or primary_surname.surname,
"prefix": primary_surname.prefix, "prefix": primary_surname.prefix or "prefix",
"suffix": name.suffix or "suffix", "suffix": name.suffix or "suffix",
"first_name": name.first_name, "first_name": name.first_name,
"name_type": name.name_type, "name_type": name.name_type,

View File

@ -522,7 +522,10 @@ def render(formfield, user, action, test=False, truetext=""):
if action == "view": if action == "view":
if (not user.is_authenticated() and not test) or user.is_authenticated(): if (not user.is_authenticated() and not test) or user.is_authenticated():
fieldname = formfield.name # 'surname' fieldname = formfield.name # 'surname'
retval = str(getattr(formfield.form.model, fieldname)) try:
retval = str(getattr(formfield.form.model, fieldname))
except:
retval = "???" # formfield._data()
else: else:
retval = truetext retval = truetext
else: else: