Skip to content

Commit

Permalink
don't try to auth when username is blank
Browse files Browse the repository at this point in the history
  • Loading branch information
bdzim committed Oct 17, 2017
1 parent a7f9795 commit 4057596
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
21 changes: 11 additions & 10 deletions django/apps/blue_management/blue_mgnt/views/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion netkes/account_mgr/billing_api.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import json
import logging
import requests

Expand Down

0 comments on commit 4057596

Please sign in to comment.