Skip to content

Commit

Permalink
chore(github): use Flask means to extract org & repo
Browse files Browse the repository at this point in the history
  • Loading branch information
vit-zikmund committed Mar 6, 2024
1 parent f6a7cbc commit d622b91
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion giftless/auth/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,8 @@ def _extract_token(self, request: flask.Request) -> str:
return token

def __post_init__(self, request: flask.Request) -> None:
self.org, self.repo = request.path.split("/", maxsplit=3)[1:3]
org_repo_getter = itemgetter("organization", "repo")
self.org, self.repo = org_repo_getter(request.view_args or {})
self.token = self._extract_token(request)

def __init__(self, cfg: Config) -> None:
Expand Down

0 comments on commit d622b91

Please sign in to comment.