def get_username(user, context=None): username = cleansed_username(user) if "." in username: sso_me = sso.get_logged_in_user_details(context) if sso_me: return f"{sso_me.get('first_name', '')} {sso_me.get('last_name', '')}" return username
def to_representation(self, value): return { "id": value.id, "name": cleansed_username(value), }
def _cleansed_username(self, user): return cleansed_username(user)
def _format_user(self, user): if user is not None: return {"id": user.id, "name": cleansed_username(user)} return None
def get_full_name(self, obj): return cleansed_username(obj)