I think you can do this:
user_name = user_obj['name'] || user_login