/add uses it own context now instead of make_context_index

This commit is contained in:
2023-01-29 01:27:31 +01:00
parent 51be6c59d9
commit d5ac378664

View File

@ -348,7 +348,11 @@ async def post_use_text(feed_url: str = Form()):
@app.get("/add", response_class=HTMLResponse)
def get_add(request: Request):
"""Page for adding a new feed."""
return templates.TemplateResponse("add.html", make_context_index(request))
context = {
"request": request,
"webhooks": reader.get_tag((), "webhooks", []),
}
return templates.TemplateResponse("add.html", context)
@app.get("/feed", response_class=HTMLResponse)
@ -490,11 +494,7 @@ def get_index(request: Request):
def make_context_index(request: Request):
"""
Create the needed context for the index page.
Used by / and /add.
"""
"""Create the needed context for the index page."""
hooks: list[dict] = reader.get_tag((), "webhooks", []) # type: ignore
feed_list = []