Skip to content

Commit

Permalink
Fixed logging to distinguish between local logins
Browse files Browse the repository at this point in the history
Signed-off-by: slowr <jim.mavrommatis@gmail.com>
  • Loading branch information
slowr committed Feb 28, 2019
1 parent 89a7776 commit c7309a9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion frontend/webapp/utils/ldap/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def validate(self):
try:
admin_user = _datastore.get_user(1)
if self.email.data == admin_user.username:
current_app.artemis_logger.info("Super-user login")
return self._try_local_auth()

# first we try authenticating against ldap
Expand Down Expand Up @@ -90,6 +91,7 @@ def validate(self):
_datastore.add_role_to_user(self.user, role)
_datastore.commit()
except LDAPSocketOpenError:
current_app.artemis_logger.info("LDAP offline.. Trying local auth")
self.email.errors.append("LDAP Server offline")
return self._try_local_auth()
except LDAPExceptionError:
Expand All @@ -100,7 +102,6 @@ def validate(self):
return True

def _try_local_auth(self):
current_app.artemis_logger.info("LDAP failed.. trying local auth")
self.user = _datastore.get_user(self.email.data)

if not self.user:
Expand Down

0 comments on commit c7309a9

Please sign in to comment.