]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/views/commands.py
Applies patches by Justing Grant. Makes several improvements in the db exporter.
[osqa.git] / forum / views / commands.py
index ea584062b4cfe3d4ff43b67e4a6e51a581acfd7f..7b44322edfa29ca979231e024476cb118778fd03 100644 (file)
@@ -490,7 +490,7 @@ def matching_tags(request):
     if len(request.GET['q']) == 0:
         raise CommandException(_("Invalid request"))
 
     if len(request.GET['q']) == 0:
         raise CommandException(_("Invalid request"))
 
-    possible_tags = Tag.active.filter(name__istartswith = request.GET['q'])
+    possible_tags = Tag.active.filter(name__icontains = request.GET['q'])
     tag_output = ''
     for tag in possible_tags:
         tag_output += "%s|%s|%s\n" % (tag.id, tag.name, tag.used_count)
     tag_output = ''
     for tag in possible_tags:
         tag_output += "%s|%s|%s\n" % (tag.id, tag.name, tag.used_count)
@@ -501,7 +501,7 @@ def matching_users(request):
     if len(request.GET['q']) == 0:
         raise CommandException(_("Invalid request"))
 
     if len(request.GET['q']) == 0:
         raise CommandException(_("Invalid request"))
 
-    possible_users = User.objects.filter(username__istartswith = request.GET['q'])
+    possible_users = User.objects.filter(username__icontains = request.GET['q'])
     output = ''
 
     for user in possible_users:
     output = ''
 
     for user in possible_users: