Skip to content

Commit

Permalink
Log when number of patterns mismatch number of URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
sagarun committed Sep 24, 2011
1 parent 85ceec2 commit 10ff7a3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion askbot/utils/markup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import re
import logging
from askbot import const
from askbot.conf import settings as askbot_settings
from markdown2 import Markdown
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 10ff7a3

Please sign in to comment.