Hello, Iain.

Those files seem to be correct. Can you please attach amberweb.lib.auth, 
amberweb.model and amberweb.model.meta too?

This is how my add_auth() function looks like, just in case:
"""
from pylonsproject.config.environment import load_environment
from pylonsproject.model import meta, User, Group, Permission

from repoze.what.plugins.quickstart import setup_sql_auth

def add_auth(app):
    app = setup_sql_auth(app, User, Group, Permission, meta.Session,
                         post_login_url='/welcome_back',
                         post_logout_url='/see_you_later',
                         log_level=logging.DEBUG)

"""

Cheers.

On Tuesday February 17, 2009 10:07:24 Iain Campbell wrote:
> Hi Gustavo,
>
> Thanks for that, I've checked through the attached files and can't see
> much wrong with what I've done so far?
>
> I've attached my config.middleware and model.auth as requested. The
> only difference I can see is that I'm using 'users' and 'groups' as
> the table names in place of 'user' and 'group', but I've declared
> those changes in the model.
>
> Also, here's the full traceback I receive when POSTing the login
> information. I'm running Pylons 0.9.7rc4
>
> --------------------
> URL:
> http://localhost:4000/login_handler?__logins=0&came_from=http%3A//localhost
>%3A4000/ File
> '/usr/lib/python2.5/site-packages/WebError-0.9.1-py2.5.egg/weberror/evalexc
>eption.py', line 428 in respond
>   app_iter = self.application(environ, detect_start_response)
> File
> '/usr/lib/python2.5/site-packages/Beaker-1.1.3-py2.5.egg/beaker/middleware.
>py', line 81 in __call__
>   return self.app(environ, start_response)
> File
> '/usr/lib/python2.5/site-packages/Beaker-1.1.3-py2.5.egg/beaker/middleware.
>py', line 159 in __call__
>   return self.wrap_app(environ, session_start_response)
> File
> '/usr/lib/python2.5/site-packages/Routes-1.10.1-py2.5.egg/routes/middleware
>.py', line 118 in __call__
>   response = self.app(environ, start_response)
> File
> '/usr/lib/python2.5/site-packages/repoze.who-1.0.10-py2.5.egg/repoze/who/mi
>ddleware.py', line 69 in __call__
>   auth_ids = self.authenticate(environ, classification, ids)
> File
> '/usr/lib/python2.5/site-packages/repoze.who-1.0.10-py2.5.egg/repoze/who/mi
>ddleware.py', line 193 in authenticate
>   userid = plugin.authenticate(environ, identity)
> File
> '/usr/lib/python2.5/site-packages/repoze.who.plugins.sa-1.0rc1-py2.5.egg/re
>poze/who/plugins/sa.py', line 112 in authenticate
>   user = self.get_user(identity['login'])
> File
> '/usr/lib/python2.5/site-packages/repoze.who.plugins.sa-1.0rc1-py2.5.egg/re
>poze/who/plugins/sa.py', line 52 in get_user
>   query = self.dbsession.query(self.user_class)
> AttributeError: 'NoneType' object has no attribute 'query'
> -----------------
>
> Many thanks,
>
> Iain
>
> 2009/2/16 Gustavo Narea <m...@gustavonarea.net>:
> > Hello, Iain.
> >
> > Can you please paste the contents of {app}.config.middleware, and the
> > file where you define auth-related models?
> >
> > Just in case, I've attached the model package from a fake Pylons project
> > I use to test this plugin.
> >
> > Cheers.
> >
> > On Saturday February 14, 2009 11:55:13 Iain Campbell wrote:
> >> Hi all,
> >>
> >> I've set up repoze.who & repoze.what using the new quickstart.
> >> Everything's defined as per the tutorial, with the exception of the
> >> relevant table names which have been updated in the model. All column,
> >> property and class names are the same.
> >>
> >> When I submit the login form, I get:
> >> > Module repoze.who.plugins.sa:52 in get_user
> >> > query = self.dbsession.query(self.user_class)
> >> > AttributeError: 'NoneType' object has no attribute 'query'
> >>
> >> dbsession isn't initialised for some reason but I can't work out why...
> >>
> >> Any help/pointers appreciated. If there's anything more I can post
> >> that may help, please shout.
> >>
> >> Thanks,
> >>
> >> Iain
> >
> > --
> > Gustavo Narea <http://gustavonarea.net/>.
> >
> > Get rid of unethical constraints! Get freedomware:
> > http://www.getgnulinux.org/

-- 
Gustavo Narea <http://gustavonarea.net/>.

Get rid of unethical constraints! Get freedomware:
http://www.getgnulinux.org/
_______________________________________________
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev

Reply via email to