Skip to content

Commit

Permalink
Changed admin apis from async to sync
Browse files Browse the repository at this point in the history
  • Loading branch information
guffee23 committed Sep 29, 2023
1 parent 562a06f commit 086a75f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/routers/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@

@router.get("/me/", response_model=AuthenticatedUser)
@requires("authenticated")
async def get_me(request: Request):
def get_me(request: Request):
return request.user


@router.put("/me/", status_code=HTTPStatus.ACCEPTED, dependencies=[Depends(check_domain)])
@requires("manage-account")
async def update_me(request: Request, user: UserProfile):
def update_me(request: Request, user: UserProfile):
oauth2_admin.update_user(request.user.id, user.dict(by_alias=True, exclude={"leis"}))
if user.leis:
oauth2_admin.associate_to_leis(request.user.id, user.leis)


@router.put("/me/institutions/", status_code=HTTPStatus.ACCEPTED, dependencies=[Depends(check_domain)])
@requires("manage-account")
async def associate_lei(request: Request, leis: Set[str]):
def associate_lei(request: Request, leis: Set[str]):
oauth2_admin.associate_to_leis(request.user.id, leis)

0 comments on commit 086a75f

Please sign in to comment.