Set ticket title and description with URL params

Setting ?title=foo&description=bar to the tracker page will
automatically populate the title and description inputs. This can be
useful for crafting error-reporting links.
This commit is contained in:
Ivan Habunek 2019-10-23 12:29:34 +02:00 committed by Drew DeVault
parent 89512d4308
commit 62b8fe82da
1 changed files with 8 additions and 1 deletions

View File

@ -106,7 +106,14 @@ def tracker_GET(owner, name):
tracker, access = get_tracker(owner, name)
if not tracker:
abort(404)
return return_tracker(tracker, access)
# Populate title and description if given as URL parameters
kwargs = {
"title": request.args.get("title"),
"description": request.args.get("description"),
}
return return_tracker(tracker, access, **kwargs)
@tracker.route("/<owner>/<name>/enable_notifications", methods=["POST"])
@loginrequired