From 477d8f7ff92b4c70fd2ff6ab545871cf1eb8189b Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Aug 24 2016 09:13:24 +0000 Subject: Build the URL to the user's page by hand instead of relying on flask This is most useful for when adding a comment to a PR/ticket via a hook action. --- diff --git a/pagure/pfmarkdown.py b/pagure/pfmarkdown.py index 9068b6a..f4762b8 100644 --- a/pagure/pfmarkdown.py +++ b/pagure/pfmarkdown.py @@ -49,7 +49,10 @@ class MentionPattern(markdown.inlinepatterns.Pattern): return text element = markdown.util.etree.Element("a") - url = flask.url_for('view_user', username=name) + base_url = pagure.APP.config['APP_URL'] + if base_url.endswith('/'): + base_url = base_url[:-1] + url = '%s/user/%s' % (base_url, user.username) element.set('href', url) element.text = text return element