code: def username_or(user, attr):
      
      if not settings.ACCOUNTS_NO_USERNAME:
          attr = "username"
      value = getattr(user, attr)
      if callable(value):
          value = value()
      return value
docs: Returns the user's username for display, or an alternate attribute
      if ``ACCOUNTS_NO_USERNAME`` is set to ``True``.