X-Git-Url: http://git.veekun.com/zzz-floof.git/blobdiff_plain/525fe6090b7ff002198c4a58dc9cb90d774b8cd0..dc9ecbad36153af00773b4951120b4697b33193e:/floof/controllers/users.py diff --git a/floof/controllers/users.py b/floof/controllers/users.py index 1758653..1e251f0 100644 --- a/floof/controllers/users.py +++ b/floof/controllers/users.py @@ -2,6 +2,8 @@ import logging 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 floof.model.users import User @@ -17,3 +19,14 @@ class UsersController(BaseController): c.users = User.query.all() return render('/users/index.mako') + + def view(self, name): + """Userpage.""" + + try: + c.this_user = User.query.filter(func.lower(User.name) == name) \ + .one() + except NoResultFound: + abort(404) + + return render('/users/view.mako')