Commit 20145176 authored by Martin Lavoie's avatar Martin Lavoie Committed by Vincent A

[orange] Update the handling of expired password

I hardcode the message since it is not in the response anymore.
parent 62ea83a5
......@@ -19,10 +19,6 @@
from __future__ import unicode_literals
import lxml.html as html
from io import StringIO
from woob.browser.pages import HTMLPage, LoggedPage, JsonPage, RawPage
from woob.browser.filters.standard import CleanText, Format
......@@ -34,28 +30,9 @@ class LoginPage(RawPage):
class PasswordPage(JsonPage):
ENCODING = 'utf-8'
def get_change_password_message(self):
if self.doc.get('stage') != 'changePassword':
# when stage is not present everything is okay, and if it's not changePassword we prefer do nothing here
return
if 'mandatory' not in self.doc['options']:
# maybe there are some cases where it's optional
return
encoding = self.encoding
if encoding == 'latin-1':
encoding = 'latin1'
if encoding:
encoding = encoding.replace('ISO8859_', 'ISO8859-')
parser = html.HTMLParser(encoding=encoding)
html_doc = html.parse(StringIO(self.doc['view']), parser)
# message should be:
# Votre mot de passe actuel n’est pas suffisamment sécurisé et doit être renforcé.
# Veuillez le modifier pour accéder à vos services Orange.
return CleanText('//p[@id="cnMsg"]')(html_doc)
if self.doc.get('step') == 'mandatory':
# The password expired message on the website is fetched from a javascript file.
return 'Votre mot de passe actuel n’est pas suffisamment sécurisé et doit être renforcé.'
class ManageCGI(HTMLPage):
pass
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment