Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def handleMatch(self, m):
username = self.unescape(m.group(2))
"""Makesure `username` is registered and actived."""
if MARTOR_ENABLE_CONFIGS['mention'] == 'true':
if username in [u.username for u in User.objects.exclude(is_active=False)]:
url = '{0}{1}/'.format(MARTOR_MARKDOWN_BASE_MENTION_URL, username)
el = markdown.util.etree.Element('a')
el.set('href', url)
el.set('class', 'direct-mention-link')
el.text = markdown.util.AtomicString('@' + username)
return el
'martor/css/martor.min.css',
'martor/css/martor-admin.min.css'
)
}
js = (
'plugins/js/ace.js',
'plugins/js/semantic.min.js',
'plugins/js/mode-markdown.js',
'plugins/js/ext-language_tools.js',
'plugins/js/theme-github.js',
'plugins/js/highlight.min.js',
'plugins/js/resizable.min.js',
'plugins/js/emojis.min.js',
'martor/js/martor.min.js',
)
if MARTOR_ENABLE_CONFIGS['jquery'] == 'true':
js = ('plugins/js/jquery.min.js',).__add__(js)
class AdminMartorWidget(MartorWidget, widgets.AdminTextareaWidget):
pass