X-Git-Url: http://git.veekun.com/zzz-spline-users.git/blobdiff_plain/4aafbf548ba21c9b8d8d0d7486b428195a4a87ce..fde249255b5fd62df1cb1eb71975aac36de5d8b6:/splinext/users/__init__.py diff --git a/splinext/users/__init__.py b/splinext/users/__init__.py index 39318f0..a6a6ca7 100644 --- a/splinext/users/__init__.py +++ b/splinext/users/__init__.py @@ -4,12 +4,11 @@ from pylons import c, session from spline.lib.plugin import PluginBase from spline.lib.plugin import PluginBase, PluginLink, Priority -import spline.model as model import spline.model.meta as meta import splinext.users.controllers.accounts import splinext.users.controllers.users -import splinext.users.model +from splinext.users import model as users_model def add_routes_hook(map, *args, **kwargs): """Hook to inject some of our behavior into the routes configuration.""" @@ -32,16 +31,17 @@ def check_userid_hook(action, **params): c. """ - c.user = None - if not 'user_id' in session: + c.user = users_model.AnonymousUser() return - user = meta.Session.query(model.User).get(session['user_id']) + user = meta.Session.query(users_model.User).get(session['user_id']) if not user: # Bogus id in the session somehow. Clear it del session['user_id'] session.save() + + c.user = users_model.AnonymousUser() return c.user = user @@ -54,12 +54,6 @@ class UsersPlugin(PluginBase): users = splinext.users.controllers.users.UsersController, ) - def model(self): - return [ - splinext.users.model.User, - splinext.users.model.OpenID, - ] - def template_dirs(self): return [ (resource_filename(__name__, 'templates'), Priority.NORMAL)