Don't pass token into AvatarGitHub
, it works perfectly without it
Signed-off-by: magic_rb <richard@brezak.sk>
This commit is contained in:
parent
3389164c13
commit
458b39fc3a
|
@ -650,22 +650,7 @@ class GithubBackend(GitBackend):
|
|||
}
|
||||
|
||||
def create_avatar_method(self) -> AvatarBase | None:
|
||||
avatar = AvatarGitHub(token=self.auth_backend.get_general_token().get())
|
||||
|
||||
# TODO: not a proper fix, the /users/{username} endpoint is per installation, but I'm not sure
|
||||
# how to tell which installation token to use, unless there is a way to build a huge map of
|
||||
# username -> token, or we just try each one in order
|
||||
def _get_avatar_by_username(self: Any, username: Any) -> Any:
|
||||
return f"https://github.com/{username}.png"
|
||||
|
||||
import types
|
||||
|
||||
avatar._get_avatar_by_username = types.MethodType( # noqa: SLF001
|
||||
_get_avatar_by_username,
|
||||
avatar,
|
||||
)
|
||||
|
||||
return avatar
|
||||
return AvatarGitHub()
|
||||
|
||||
def create_auth(self) -> AuthBase:
|
||||
assert self.config.oauth_id is not None, "GitHub OAuth ID is required"
|
||||
|
|
Loading…
Reference in a new issue