File tree Expand file tree Collapse file tree 3 files changed +3
-12
lines changed
Expand file tree Collapse file tree 3 files changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -3,15 +3,6 @@ sudo: false
33
44matrix :
55 include :
6- - python : 2.7
7- env : DJANGO="==1.8.*"
8- - python : 2.7
9- env : DJANGO="==1.9.*"
10- - python : 2.7
11- env : DJANGO="==1.10.*"
12- - python : 2.7
13- env : DJANGO="==1.11.*"
14-
156 - python : 3.4
167 env : DJANGO="==1.8.*"
178 - python : 3.4
Original file line number Diff line number Diff line change 11import markdown
2- from django .contrib .auth . models import User
2+ from django .contrib .auth import get_user_model
33from ..settings import (
44 MARTOR_ENABLE_CONFIGS ,
55 MARTOR_MARKDOWN_BASE_MENTION_URL
@@ -23,10 +23,11 @@ class MentionPattern(markdown.inlinepatterns.Pattern):
2323
2424 def handleMatch (self , m ):
2525 username = self .unescape (m .group (2 ))
26+ users = get_user_model ().objects .filter (username = username , is_active = True )
2627
2728 """Makesure `username` is registered and actived."""
2829 if MARTOR_ENABLE_CONFIGS ['mention' ] == 'true' :
29- if username in [ u . username for u in User . objects . exclude ( is_active = False )] :
30+ if users . exists () :
3031 url = '{0}{1}/' .format (MARTOR_MARKDOWN_BASE_MENTION_URL , username )
3132 el = markdown .util .etree .Element ('a' )
3233 el .set ('href' , url )
Original file line number Diff line number Diff line change @@ -35,7 +35,6 @@ def get_requirements():
3535 'Operating System :: OS Independent' ,
3636 'Programming Language :: JavaScript' ,
3737 'Programming Language :: Python' ,
38- 'Programming Language :: Python :: 2.7' ,
3938 'Programming Language :: Python :: 3.4' ,
4039 'Programming Language :: Python :: 3.5' ,
4140 'Programming Language :: Python :: 3.6' ,
You can’t perform that action at this time.
0 commit comments