diff --git a/kallithea/lib/helpers.py b/kallithea/lib/helpers.py
--- a/kallithea/lib/helpers.py
+++ b/kallithea/lib/helpers.py
@@ -1137,7 +1137,7 @@ def urlify_issues(newtext, repo_name):
issue_pat = CONFIG.get(k)
issue_server_link = CONFIG.get('issue_server_link%s' % suffix)
issue_prefix = CONFIG.get('issue_prefix%s' % suffix)
- if issue_pat and issue_server_link and issue_prefix:
+ if issue_pat and issue_server_link and issue_prefix is not None: # issue_prefix can be empty but should be present
log.debug('issue pattern %r: %r -> %r %r', suffix, issue_pat, issue_server_link, issue_prefix)
else:
log.error('skipping incomplete issue pattern %r: %r -> %r %r', suffix, issue_pat, issue_server_link, issue_prefix)
diff --git a/kallithea/tests/other/test_libs.py b/kallithea/tests/other/test_libs.py
--- a/kallithea/tests/other/test_libs.py
+++ b/kallithea/tests/other/test_libs.py
@@ -415,7 +415,7 @@ class TestLibs(TestController):
(r'BUG(\d{5})', 'https://bar/{repo}/', 'BUG',
'silly me, the URL does not contain {id}, BUG12345.', 'silly me, the URL does not contain {id}, BUG12345.'),
(r'(PR-\d+)', 'http://foo/{repo}/issue/{id}', '',
- 'interesting issue #123, err PR-56', 'interesting issue #123, err PR-56'), # no match because empty prefix
+ 'interesting issue #123, err PR-56', 'interesting issue #123, err PR-56'),
])
def test_urlify_issues(self, issue_pat, issue_server, issue_prefix, sample, expected):
from kallithea.lib.helpers import urlify_issues
@@ -436,7 +436,7 @@ class TestLibs(TestController):
('pull request7 #', 'PR#7 #'),
('look PR9 and pr #11', 'look PR#9 and PR#11'),
('pullrequest#10 solves issue 9', 'PR#10 solves bug#9'),
- ('issue FAIL67', 'issue FAIL67'), # no match because empty prefix
+ ('issue FAIL67', 'issue 67'),
('issue FAILMORE89', 'issue FAILMORE89'), # no match because absent prefix
])
def test_urlify_issues_multiple_issue_patterns(self, sample, expected):