From d91ecf910f604b7fddcea02679e617f665e46eba Mon Sep 17 00:00:00 2001 From: Ras Fincher Date: Fri, 7 May 2021 11:24:44 -0400 Subject: [PATCH] Add query params to auto-fill new topic title/link --- tildes/tildes/views/topic.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tildes/tildes/views/topic.py b/tildes/tildes/views/topic.py index 675144e..0892d3e 100644 --- a/tildes/tildes/views/topic.py +++ b/tildes/tildes/views/topic.py @@ -397,11 +397,12 @@ def get_search( @view_config( route_name="new_topic", renderer="new_topic.jinja2", permission="topic.post" ) -def get_new_topic_form(request: Request) -> dict: +@use_kwargs({"title": String(missing=""), "link": String(missing="")}) +def get_new_topic_form(request: Request, title: str, link: str) -> dict: """Form for entering a new topic to post.""" group = request.context - return {"group": group} + return {"group": group, "title": title, "link": link} @view_config(route_name="topic", renderer="topic.jinja2")