Ocurre un error al intentar recuperar la contraseña usando un servidor de mail que no existe o es inválido. Propongo la elaboración de una salida de excepción para eventuales casos de errores de tipeo. El error fue así:
Error ticket for "OpenLex"
<class 'Exception'> Server address not specified
Versión
web2py™ | Version 2.21.1-stable+timestamp.2020.11.27.18.21.43
Python 3.7.3: /usr/bin/python3 (prefix: /usr)
Rastreo
Traceback (most recent call last):
File "/home/myuser/web2py/gluon/restricted.py", line 219, in restricted
exec(ccode, environment)
File "/home/myuser/web2py/applications/OpenLex/controllers/default.py", line 57, in
File "/home/myuser/web2py/gluon/globals.py", line 430, in
self._caller = lambda f: f()
File "/home/myuser/web2py/applications/OpenLex/controllers/default.py", line 55, in user
return dict(form=auth())
File "/home/myuser/web2py/gluon/tools.py", line 1809, in call
return getattr(self, args[0])()
File "/home/myuser/web2py/gluon/tools.py", line 3503, in request_reset_password
if self.email_reset_password(user):
File "/home/myuser/web2py/gluon/tools.py", line 3527, in email_reset_password
message=self.messages.reset_password % d):
File "/home/myuser/web2py/gluon/tools.py", line 431, in send
raise Exception('Server address not specified')
Exception: Server address not specified
Frames
File /home/myuser/web2py/gluon/restricted.py in restricted at line 219
File /home/myuser/web2py/applications/OpenLex/controllers/default.py in <module> at line 57
File /home/myuser/web2py/gluon/globals.py in <lambda> at line 430
File /home/myuser/web2py/applications/OpenLex/controllers/default.py in user at line 55
File /home/myuser/web2py/gluon/tools.py in __call__ at line 1809
File /home/myuser/web2py/gluon/tools.py in request_reset_password at line 3503
File /home/myuser/web2py/gluon/tools.py in email_reset_password at line 3527
File /home/myuser/web2py/gluon/tools.py in send at line 431
Function argument list
(self=, to='example@example.com', subject=<lazyT 'Password reset'>, message=<lazyT 'Click on the link %(link)s to reset your password'>, attachments=None, cc=None, bcc=None, reply_to=None, sender=None, encoding='utf-8', raw=False, headers={}, from_address=None, cipher_type=None, sign=None, sign_passphrase=None, encrypt=None, x509_sign_keyfile=None, x509_sign_chainfile=None, x509_sign_certfile=None, x509_crypt_certfiles=None, x509_nocerts=None)
Code listing
return text
sender = sender or self.settings.sender
if not isinstance(self.settings.server, str):
raise Exception('Server address not specified')
if not isinstance(sender, str):
raise Exception('Sender address not specified')
if not raw and attachments:
Variables
builtinException <class 'Exception'>
In file: /home/myuser/web2py/applications/OpenLex/controllers/default.py
<code object at 0x7f65a854e8a0, file "/home/myuser/web2py/applications/OpenLex/controllers/default.py", line 2>
Estuve viendo otra solucion que es restringir el login al usuario la segunda vez que entre si no verifica su correo electronico.
La solucion aparece en Web2py book.
Ocurre un error al intentar recuperar la contraseña usando un servidor de mail que no existe o es inválido. Propongo la elaboración de una salida de excepción para eventuales casos de errores de tipeo. El error fue así:
Error ticket for "OpenLex"
<class 'Exception'> Server address not specified
Versión web2py™ | Version 2.21.1-stable+timestamp.2020.11.27.18.21.43 Python 3.7.3: /usr/bin/python3 (prefix: /usr)
Rastreo
Frames
Function argument list
(self=, to='example@example.com', subject=<lazyT 'Password reset'>, message=<lazyT 'Click on the link %(link)s to reset your password'>, attachments=None, cc=None, bcc=None, reply_to=None, sender=None, encoding='utf-8', raw=False, headers={}, from_address=None, cipher_type=None, sign=None, sign_passphrase=None, encrypt=None, x509_sign_keyfile=None, x509_sign_chainfile=None, x509_sign_certfile=None, x509_crypt_certfiles=None, x509_nocerts=None)
Code listing
Variables builtinException <class 'Exception'>
In file: /home/myuser/web2py/applications/OpenLex/controllers/default.py
Link del issue