diff --git a/django/apps/blue_management/blue_mgnt/views/settings.py b/django/apps/blue_management/blue_mgnt/views/settings.py index 6bd344c..dd0256c 100644 --- a/django/apps/blue_management/blue_mgnt/views/settings.py +++ b/django/apps/blue_management/blue_mgnt/views/settings.py @@ -87,16 +87,17 @@ def clean_ip_block(self): def login_test(config, username, password): - if account_mgr.authenticator(config, username, password, False): - return 'Authentication was successful!' - else: - conn = ldap.initialize(config['dir_uri']) - try: - auth_user = get_auth_username(config, username) - conn.simple_bind_s(auth_user, password) - except Exception, e: - return 'Authentication failed. {}'.format(e) - return 'Authentication failed.' + if username: + if account_mgr.authenticator(config, username, password, False): + return 'Authentication was successful!' + else: + conn = ldap.initialize(config['dir_uri']) + try: + auth_user = get_auth_username(config, username) + conn.simple_bind_s(auth_user, password) + except Exception, e: + return 'Authentication failed. {}'.format(e) + return 'Authentication failed.' @enterprise_required diff --git a/netkes/account_mgr/billing_api.py b/netkes/account_mgr/billing_api.py index 2a523a2..f0d1e5a 100644 --- a/netkes/account_mgr/billing_api.py +++ b/netkes/account_mgr/billing_api.py @@ -1,4 +1,3 @@ -import json import logging import requests