PyAr / OpenLex

Software para el manejo de estudios jurídicos y oficinas judiciales
GNU General Public License v3.0
20 stars 22 forks source link

Error al colocar servidor de mail inválido al Recuperar Contraseña #46

Open matiasdemarchi opened 3 years ago

matiasdemarchi commented 3 years ago

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

  1. Traceback (most recent call last):
  2. File "/home/myuser/web2py/gluon/restricted.py", line 219, in restricted
  3. exec(ccode, environment)
  4. File "/home/myuser/web2py/applications/OpenLex/controllers/default.py", line 57, in
  5. File "/home/myuser/web2py/gluon/globals.py", line 430, in
  6. self._caller = lambda f: f()
  7. File "/home/myuser/web2py/applications/OpenLex/controllers/default.py", line 55, in user
  8. return dict(form=auth())
  9. File "/home/myuser/web2py/gluon/tools.py", line 1809, in call
  10. return getattr(self, args[0])()
  11. File "/home/myuser/web2py/gluon/tools.py", line 3503, in request_reset_password
  12. if self.email_reset_password(user):
  13. File "/home/myuser/web2py/gluon/tools.py", line 3527, in email_reset_password
  14. message=self.messages.reset_password % d):
  15. File "/home/myuser/web2py/gluon/tools.py", line 431, in send
  16. raise Exception('Server address not specified')
  17. 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

  1. return text
  2. sender = sender or self.settings.sender
  3. if not isinstance(self.settings.server, str):
  4. raise Exception('Server address not specified')
  5. if not isinstance(sender, str):
  6. raise Exception('Sender address not specified')
  7. if not raw and attachments:

Variables builtinException <class 'Exception'>

In file: /home/myuser/web2py/applications/OpenLex/controllers/default.py

  1. <code object at 0x7f65a854e8a0, file "/home/myuser/web2py/applications/OpenLex/controllers/default.py", line 2>

Link del issue

Juerodriguez commented 3 years ago

https://github.com/haimavni/place_stories_server/blob/a510aa0fcb659b13a9860cbe5d091f862f1006fa/modules/my_auth.py

Juerodriguez commented 3 years ago

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. restricciones

@eamanu, @matiasdemarchi , @marian-vignau.