members.lumbung.space/members_lumbung_space/routes/root.py
cellarspoon a41ee93cb0
All checks were successful
continuous-integration/drone/push Build is passing
fix: link to auth urls
2022-01-13 15:04:24 +01:00

49 lines
1.1 KiB
Python

"""Home routes."""
from fastapi import APIRouter, Depends, Request
from members_lumbung_space.dependencies import (
get_invites,
get_resource_map,
get_user,
logged_in,
)
router = APIRouter()
@router.get("/", dependencies=[Depends(logged_in)])
async def home(
request: Request,
user=Depends(get_user),
invites=Depends(get_invites),
resource_map=Depends(get_resource_map),
):
context = {
"request": request,
"user": user,
"invites": invites,
"resource_map": resource_map,
}
request.app.state.templates.env.filters["zip"] = zip
return request.app.state.templates.TemplateResponse(
"admin.html", context=context
)
@router.get("/invites", dependencies=[Depends(logged_in)])
async def invites(
request: Request,
user=Depends(get_user),
invites=Depends(get_invites),
):
context = {
"request": request,
"user": user,
"invites": invites,
}
return request.app.state.templates.TemplateResponse(
"invites.html", context=context
)