you probably have a too short password length, should be 512.
--
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to web2py+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
Traceback (most recent call last):
File "gluon/restricted.py", line 173, in restricted
exec ccode in environment
File "/home/web2py/applications/convenios/controllers/default.py", line 354, in <module>
File "gluon/globals.py", line 96, in <lambda>
self._caller = lambda f: f()
File "/home/web2py/applications/convenios/controllers/default.py", line 321, in user
return dict(form=auth())
File "gluon/tools.py", line 729, in __call__
return self.retrieve_password()
File "gluon/tools.py", line 1621, in retrieve_password
return self.reset_password_deprecated(next,onvalidation,onaccept,log)
File "gluon/tools.py", line 1460, in reset_password_deprecated
d = {passfield: user[passfield].validate(password)[0],
AttributeError: 'str' object has no attribute 'validate'
--
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to web2py+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
user = self.db(table_user.email ==
form.vars.email).select().first()
....
d = {passfield: user[passfield].validate(password)[0],
'registration_key': ''}
according to your error it says user[passfield] is a str. It cannot be
be. From the code above it is clearly a record. Can you add a print
statement as see what is going on?
Can you also print your code for custom auth?
Massimo
On Feb 8, 12:03 pm, Alexandre Andrade <alexandrema...@gmail.com>
wrote:
> Now, using the other example, get the error:
>
> Traceback (most recent call last):
> File "gluon/restricted.py", line 173, in restricted
> exec ccode in environment
> File "/home/web2py/applications/convenios/controllers/default.py"
> <https://hipercenter.com/admin/default/edit/convenios/controllers/defa...>,
> line 354, in <module>
> File "gluon/globals.py", line 96, in <lambda>
> self._caller = lambda f: f()
> File "/home/web2py/applications/convenios/controllers/default.py"
> <https://hipercenter.com/admin/default/edit/convenios/controllers/defa...>,
> line 321, in user
> return dict(form=auth())
> File "gluon/tools.py", line 729, in __call__
> return self.retrieve_password()
> File "gluon/tools.py", line 1621, in retrieve_password
> return self.reset_password_deprecated(next,onvalidation,onaccept,log)
> File "gluon/tools.py", line 1460, in reset_password_deprecated
> d = {passfield: user[passfield].validate(password)[0],
> AttributeError: 'str' object has no attribute 'validate'
>
> 2010/2/8 mdipierro <mdipie...@cs.depaul.edu>
>
>
>
> > Please use the example in here:
> >http://www.web2py.com/examples/default/tools#authentication
>
> > you probably have a too short password length, should be 512.
>
> > On Feb 8, 8:16 am, Alexandre Andrade <alexandrema...@gmail.com> wrote:
> > > I customize auth using the reference of page 245 (229 ) of the book, but
> > > after the login's of existents users don't work.
>
> > > I tried with a new app, created a user, and works. Its not possible alter
> > it
> > > after.
>
> > > How make it work with a existent auth_user table?
>
> > > --
> > > Atenciosamente
>
> > > --
> > > =========================
> > > Alexandre Andrade
> > > Hipercenter.com
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "web2py-users" group.
> > To post to this group, send email to web...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > web2py+un...@googlegroups.com<web2py%2Bunsu...@googlegroups.com>
Traceback (most recent call last):
File "gluon/restricted.py", line 173, in restricted
exec ccode in environment
File "/home/web2py/applications/convenios/controllers/default.py", line 354, in <module>
File "gluon/globals.py", line 96, in <lambda>
self._caller = lambda f: f
()
File "/home/web2py/applications/convenios/controllers/default.py", line 321, in user
return dict(form=auth())
File "gluon/tools.py", line 729, in __call__
return self.retrieve_password()
File "gluon/tools.py", line 1621, in retrieve_password
return self.reset_password_deprecated(next,onvalidation,onaccept,log)
File "gluon/tools.py", line 1460, in reset_password_deprecated
d = {passfield: user[passfield].validate(password)[0],
| character varying(512) |
To unsubscribe from this group, send email to web2py+un...@googlegroups.com.
auth.settings.table_user = db.define_table('auth_user',
Field('first_name', length=512,default=''),
Field('last_name', length=512,default=''),
Field('email', length=512,default='',
requires = [IS_EMAIL(),IS_NOT_IN_DB(db,'auth_user.email')]),
Field('password', 'password',
readable=False, label='Password',
requires=CRYPT(auth.settings.hmac_key)),
Field('registration_key', length=512,
writable=False, readable=False,default=''),
Field('reset_password_key', length=512,
writable=False, readable=False, default=''))
Sorry about this and thanks for help in debugging.
Massimo
On Feb 8, 1:42 pm, Alexandre Andrade <alexandrema...@gmail.com> wrote:
> I used the sample code ofhttp://www.web2py.com/examples/default/tools#authentication:
>
> ---------------------------
> auth=Auth(globals(),db) # authentication/authorization
> auth.settings.hmac_key='sha512:e2976f55-309d-40fc-b69d-59fc032a6438'
>
> auth.messages.access_denied = 'Insufficient privileges'
> auth.messages.logged_in = 'Logged in'
> auth.messages.email_sent = 'Email sent'
> auth.messages.unable_to_send_email = 'Unable to send email'
> auth.messages.email_verified = 'Email verified'
> auth.messages.logged_out = 'Logged out'
> auth.messages.registration_successful = 'Registration successful'
> auth.messages.invalid_email = 'Invalid email'
> auth.messages.invalid_login = 'Invalid login'
> auth.messages.invalid_user = 'Invalid user'
> auth.messages.mismatched_password = "As senhas não conferem"
> #auth.messages.verify_email = 'Click on the linkhttp://...verify_email/%(key)s
> <https://hipercenter.com/admin/default/edit/convenios/controllers/defa...>,
> line 354, in <module>
> File "gluon/globals.py", line 96, in <lambda>
> self._caller = lambda f: f()
> File "/home/web2py/applications/convenios/controllers/default.py"
> <https://hipercenter.com/admin/default/edit/convenios/controllers/defa...>,
> line 321, in user
> return dict(form=auth())
> File "gluon/tools.py", line 729, in __call__
> return self.retrieve_password()
> File "gluon/tools.py", line 1621, in retrieve_password
> return self.reset_password_deprecated(next,onvalidation,onaccept,log)
> File "gluon/tools.py", line 1460, in reset_password_deprecated
> d = {passfield: user[passfield].validate(password)[0],
>
> I'm using postgresql 8.3.8 and the field in postgresl is character
> varying(512)
>
> When I drops the code above, the auth works perfectly.
>
> 2010/2/8 mdipierro <mdipie...@cs.depaul.edu>
> > <web2py%2Bunsu...@googlegroups.com<web2py%252Buns...@googlegroups.com>