From 96be15b3dcbe89d169a54c08f912a1559c59a0c8 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Apr 09 2019 09:50:45 +0000 Subject: Fix linking to issues or PRs when pre-viewing a comment Basically the old mechanism was retrieving an user '' which was not considered to be None, so when searching for the matched issue/PR, none were found and thus the text version was returned. With this change, we ask that username, project name or project namespace are all either something or None. The code is then able to find the issue/PR referenced in a comment when previewing it. Fixes https://pagure.io/pagure/issue/4319 Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/pfmarkdown.py b/pagure/pfmarkdown.py index b0c5bc6..1666758 100644 --- a/pagure/pfmarkdown.py +++ b/pagure/pfmarkdown.py @@ -528,9 +528,9 @@ def _get_ns_repo_user(): root = flask.request.url_root url = flask.request.url - user = flask.request.args.get("user") - namespace = flask.request.args.get("namespace") - repo = flask.request.args.get("repo") + user = flask.request.args.get("user") or None + namespace = flask.request.args.get("namespace") or None + repo = flask.request.args.get("repo") or None if not user and not repo: if "fork/" in url: