summaryrefslogtreecommitdiffstats
path: root/devel
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2010-10-04 20:29:01 +0200
committerDan McGee <dan@archlinux.org>2010-10-04 20:29:01 +0200
commit5e509529f00bd50ddfc6638d92c601209664d5d8 (patch)
treef153d41727cfd44ba3f4d3221c034e5ffdb8ed1f /devel
parented49122429276ea1ee9b5b07507e9a3ba3f71cf2 (diff)
downloadarchweb-5e509529f00bd50ddfc6638d92c601209664d5d8.tar.gz
archweb-5e509529f00bd50ddfc6638d92c601209664d5d8.tar.xz
reporead: ignore nicknames in name matching code
Diffstat (limited to 'devel')
-rw-r--r--devel/management/commands/reporead.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/devel/management/commands/reporead.py b/devel/management/commands/reporead.py
index 7c46800..544c4ec 100644
--- a/devel/management/commands/reporead.py
+++ b/devel/management/commands/reporead.py
@@ -137,6 +137,10 @@ def find_user(userstring):
# one of the two name fields.
name_q = Q()
for token in name.split():
+ # ignore quoted parts; e.g. nicknames in strings
+ if re.match(r'^[\'"].*[\'"]$', token):
+ print "token match:", token
+ continue
name_q &= (Q(first_name__icontains=token) |
Q(last_name__icontains=token))
return User.objects.get(name_q)