Search for usernames literally, not with func.lower().
[zzz-floof.git] / floof / controllers / tag.py
index e57d0c5..730bf72 100644 (file)
@@ -9,7 +9,6 @@ from floof.model import Art, ArtUser, ArtUserType, Tag, TagText, User
 from floof.lib.base import BaseController, render
 from floof.lib.dbhelpers import find_or_create
 from floof.lib import helpers as h
-from sqlalchemy import func
 
 log = logging.getLogger(__name__)
 
@@ -64,8 +63,7 @@ class TagController(BaseController):
 
             # Do work!
             if prefix:
-                target_user = User.query.filter(func.lower(User.name) == tag_text) \
-                                  .one()
+                target_user = User.get_by(name=tag_text)
 
                 # Special tag; at the moment, just a relationship
                 if prefix == 'by':