From 823212a654983dd15923e49b1e5ad4eb1c3fc337 Mon Sep 17 00:00:00 2001 From: Ras Fincher Date: Tue, 6 Jun 2023 10:16:38 -0400 Subject: [PATCH] Added tags/markdown query params to new topic form --- tildes/tildes/views/topic.py | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/tildes/tildes/views/topic.py b/tildes/tildes/views/topic.py index 0d59776..b54bb1c 100644 --- a/tildes/tildes/views/topic.py +++ b/tildes/tildes/views/topic.py @@ -397,12 +397,27 @@ def get_search( @view_config( route_name="new_topic", renderer="new_topic.jinja2", permission="topic.post" ) -@use_kwargs({"title": String(missing=""), "link": String(missing="")}) -def get_new_topic_form(request: Request, title: str, link: str) -> dict: +@use_kwargs( + { + "title": String(missing=""), + "link": String(missing=""), + "tags": String(missing=""), + "markdown": String(missing=""), + } +) +def get_new_topic_form( + request: Request, title: str, link: str, tags: str, markdown: str +) -> dict: """Form for entering a new topic to post.""" group = request.context - return {"group": group, "title": title, "link": link} + return { + "group": group, + "title": title, + "link": link, + "tags": tags, + "markdown": markdown, + } @view_config(route_name="topic", renderer="topic.jinja2")