From 10ff7a37e1403f96f73918b6b30a51da1f56a654 Mon Sep 17 00:00:00 2001 From: Arun SAG Date: Sat, 24 Sep 2011 20:30:46 +0530 Subject: Log when number of patterns mismatch number of URLs --- askbot/utils/markup.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/askbot/utils/markup.py b/askbot/utils/markup.py index e458e381..3b16a5b2 100644 --- a/askbot/utils/markup.py +++ b/askbot/utils/markup.py @@ -1,4 +1,5 @@ import re +import logging from askbot import const from askbot.conf import settings as askbot_settings from markdown2 import Markdown @@ -29,10 +30,13 @@ def get_parser(): # Check whether we have matching links for all key terms, Other wise we ignore the key terms # May be we should do this test in update_callback? - print len(pattern_list), len(url_list) if len(pattern_list) == len(url_list): for i in range(0,len(pattern_list)): LINK_PATTERNS.append((re.compile(pattern_list[i].strip()),url_list[i].strip())) + else: + settings_url = askbot_settings.APP_URL+'/settings/AUTOLINK/' + logging.debug("Number of keyterms didn't match the number of links, fix this by visiting" + settings_url) + return Markdown( html4tags=True, -- cgit v1.2.3-1-g7c22