Tiny fixes: save a query for by:me, and count() is a method.
[zzz-floof.git] / floof / lib / tags.py
index e75629e..134ba6f 100644 (file)
@@ -90,9 +90,6 @@ def add_tags(art, tag_string, user):
             if prefix == 'by':
                 # XXX this needs supporting.  silently ignore for now
                 continue
-            
-            if tag_text == 'me':
-                tag_text = c.user.name
 
         # Must be 3-50 alphanumeric characters
         if not re.match('^[a-z0-9]{3,50}$', tag_text):
@@ -101,7 +98,10 @@ def add_tags(art, tag_string, user):
 
         # Do work!
         if prefix:
-            target_user = User.get_by(name=tag_text)
+            if tag_text == 'me':
+                target_user = c.user
+            else:
+                target_user = User.get_by(name=tag_text)
 
             # Special tag; at the moment, just a relationship
             if prefix == 'by':