in userbeacon/views.py [0:0]
def safe_get_realname(user_record):
"""
Builds a user "real name" (firstname, lastname) by concatenating the relevant fields from user_record.
Avoids any "can't concatenate None type" errors by filtering out null values.
:param user_record: django user record to interrogate
:return: a string representing the real name. Returns an empty string if there is no name to check.
"""
parts = filter(lambda x: x is not None, [user_record.first_name, user_record.last_name])
return " ".join(parts)