Skip to content

Commit

Permalink
Fixing has_user
Browse files Browse the repository at this point in the history
  • Loading branch information
etianen committed Jul 2, 2023
1 parent 05745fb commit 81f708d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion django_python3_ldap/ldap.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def has_user(self, **kwargs):
get_operational_attributes=True,
size_limit=1,
)
return True if self._connection.response[0].get("attributes") else False
return bool(len(self._connection.response) > 0 and self._connection.response[0].get("attributes"))


@contextmanager
Expand Down

0 comments on commit 81f708d

Please sign in to comment.