diff options
Diffstat (limited to 'devel/management')
-rw-r--r-- | devel/management/commands/reporead.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/devel/management/commands/reporead.py b/devel/management/commands/reporead.py index 7c468001..544c4ecb 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) |