Skip to content

Commit

Permalink
Merge pull request #7 from tdg5/fix-request-method-shenanigan
Browse files Browse the repository at this point in the history
Fix error related to trying to get RequestMethod
  • Loading branch information
aliev authored Mar 19, 2023
2 parents 7070e8b + f7b4994 commit 054ea72
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: "3.10.4"
python-version: "3.10.10"
- name: Install dependencies
run: |
make dev-install
Expand Down
5 changes: 4 additions & 1 deletion aioauth_fastapi/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,17 @@ async def to_oauth2_request(
headers = HTTPHeaderDict(**request.headers)
url = str(request.url)

assert method == "GET" or method == "POST"
_method: RequestMethod = method

user = None

if request.user.is_authenticated:
user = request.user

return OAuth2Request(
settings=settings,
method=RequestMethod[method],
method=_method,
headers=headers,
post=Post(**post),
query=Query(**query_params),
Expand Down

0 comments on commit 054ea72

Please sign in to comment.