code: def user_pk_to_url_str(user):
      
      User = get_user_model()
      if issubclass(type(User._meta.pk), models.UUIDField):
          if isinstance(user.pk, six.string_types):
              return user.pk
          return user.pk.hex
  
      ret = user.pk
      if isinstance(ret, six.integer_types):
          ret = int_to_base36(user.pk)
      return str(ret)
docs: This should return a string.