projects
/
zzz-floof.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7a76bb2
)
Search for usernames literally, not with func.lower().
author
Eevee
<git@veekun.com>
Sun, 6 Dec 2009 03:48:35 +0000
(19:48 -0800)
committer
Eevee
<git@veekun.com>
Sun, 6 Dec 2009 03:48:35 +0000
(19:48 -0800)
floof/controllers/art.py
patch
|
blob
|
history
floof/controllers/tag.py
patch
|
blob
|
history
floof/controllers/user_settings.py
patch
|
blob
|
history
floof/controllers/users.py
patch
|
blob
|
history
diff --git
a/floof/controllers/art.py
b/floof/controllers/art.py
index
ee1e4ad
..
bf928f0
100644
(file)
--- a/
floof/controllers/art.py
+++ b/
floof/controllers/art.py
@@
-18,7
+18,6
@@
import elixir
import os.path
import PIL
import PIL.Image
import os.path
import PIL
import PIL.Image
-from sqlalchemy import func
from sqlalchemy.exceptions import IntegrityError
from sqlalchemy.orm.exc import NoResultFound
from wtforms.validators import ValidationError
from sqlalchemy.exceptions import IntegrityError
from sqlalchemy.orm.exc import NoResultFound
from wtforms.validators import ValidationError
@@
-139,8
+138,7
@@
class ArtController(BaseController):
def watchstream(self, name):
"""Watchstream for a certain user."""
try:
def watchstream(self, name):
"""Watchstream for a certain user."""
try:
- c.watching_user = User.query.filter(func.lower(User.name) == name) \
- .one()
+ c.watching_user = User.get_by(name=name)
except NoResultFound:
abort(404)
except NoResultFound:
abort(404)
diff --git
a/floof/controllers/tag.py
b/floof/controllers/tag.py
index
e57d0c5
..
730bf72
100644
(file)
--- a/
floof/controllers/tag.py
+++ b/
floof/controllers/tag.py
@@
-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 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__)
log = logging.getLogger(__name__)
@@
-64,8
+63,7
@@
class TagController(BaseController):
# Do work!
if prefix:
# 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':
# Special tag; at the moment, just a relationship
if prefix == 'by':
diff --git
a/floof/controllers/user_settings.py
b/floof/controllers/user_settings.py
index
8d8adf0
..
de46e37
100644
(file)
--- a/
floof/controllers/user_settings.py
+++ b/
floof/controllers/user_settings.py
@@
-3,7
+3,6
@@
import logging
import elixir
from pylons import request, response, session, tmpl_context as c
from pylons.controllers.util import abort, redirect_to
import elixir
from pylons import request, response, session, tmpl_context as c
from pylons.controllers.util import abort, redirect_to
-from sqlalchemy import func
from sqlalchemy.orm.exc import NoResultFound
import floof.lib.helpers as h
from sqlalchemy.orm.exc import NoResultFound
import floof.lib.helpers as h
@@
-22,7
+21,7
@@
class UserSettingsController(BaseController):
`type`, and `add_remove` as parameters.
"""
try:
`type`, and `add_remove` as parameters.
"""
try:
- user = User.
query.filter(func.lower(User.name) == name).one(
)
+ user = User.
get_by(name=name
)
except NoResultFound:
abort(404)
except NoResultFound:
abort(404)
diff --git
a/floof/controllers/users.py
b/floof/controllers/users.py
index
1a79c15
..
7c24c0f
100644
(file)
--- a/
floof/controllers/users.py
+++ b/
floof/controllers/users.py
@@
-2,7
+2,6
@@
import logging
from pylons import request, response, session, tmpl_context as c
from pylons.controllers.util import abort, redirect_to
from pylons import request, response, session, tmpl_context as c
from pylons.controllers.util import abort, redirect_to
-from sqlalchemy import func
from sqlalchemy.orm.exc import NoResultFound
from floof.lib.base import BaseController, render
from sqlalchemy.orm.exc import NoResultFound
from floof.lib.base import BaseController, render
@@
-24,8
+23,7
@@
class UsersController(BaseController):
"""Userpage."""
try:
"""Userpage."""
try:
- c.this_user = User.query.filter(func.lower(User.name) == name) \
- .one()
+ c.this_user = User.get_by(name=name)
except NoResultFound:
abort(404)
except NoResultFound:
abort(404)