mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
deluge: Fix set default daemon
Signed-off-by: Veiko Aasa <veiko17@disroot.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
1 parent
ff27f1d21b
commit
721e09fee9
2 files changed
+50
-9
No files matched your search
@@ -320,8 +320,20 @@ def _deluge_get_active_window_title(browser):
|
||||
def _deluge_ensure_logged_in(browser):
|
||||
"""Ensure that password dialog is answered and we can interact."""
|
||||
url = config['DEFAULT']['url'] + '/deluge'
|
||||
|
||||
def service_is_available():
|
||||
if browser.is_element_present_by_xpath(
|
||||
'//h1[text()="Service Unavailable"]'):
|
||||
access_url(browser, 'deluge')
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
if browser.url != url:
|
||||
browser.visit(url)
|
||||
# After a backup restore, service may not be available immediately
|
||||
eventually(service_is_available)
|
||||
|
||||
time.sleep(1) # Wait for Ext.js application in initialize
|
||||
|
||||
if _deluge_get_active_window_title(browser) != 'Login':
|
||||
|
||||
Reference in new issue
Block a user