Use startswith instead of contains to avoid conflicts.

see #631
This commit is contained in:
Antoine Nguyen
2014-11-05 10:48:05 +01:00
parent 61d1612ed2
commit 37f2e2e687
+1 -1
View File
@@ -63,7 +63,7 @@ def check_domain_access(user, pattern):
return "global"
for target in targets:
results = target.objects.filter(name__contains=pattern)
results = target.objects.filter(name__startswith=pattern)
if results.count() != 1:
continue
if not user.can_access(results[0]):