From 1282a32cb16220dff0504f16135437677b3461e7 Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Sun, 28 Jul 2013 22:54:39 +0200 Subject: [PATCH] cragr: do not fallback on mobile website when homepage isn't the accounts list --- modules/cragr/web/browser.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/cragr/web/browser.py b/modules/cragr/web/browser.py index 407b9c0c..db59ad5d 100644 --- a/modules/cragr/web/browser.py +++ b/modules/cragr/web/browser.py @@ -115,6 +115,14 @@ class Cragr(BaseBrowser): if self.is_on_page(LoginErrorPage): raise BrowserIncorrectPassword() + if self.page is None: + raise self.WebsiteNotSupported() + + if not self.is_on_page(AccountsPage): + # Sometimes the home page is Releves. + new_url = re.sub('act=([^&=]+)', 'act=Synthcomptes', self.page.url, 1) + self.location(new_url) + if not self.is_on_page(AccountsPage): raise self.WebsiteNotSupported()