Open
Description
Previously there was a section of code that started on line 586 which handles whether or not an LDAP record was found. It takes the following format.
if record:
...
else:
...
On the commit found here: 4b9c83b
That got nested under a for loop in attempt to process multiple records like such:
for record in responses:
if record:
...
else:
...
The problem is that if no record exists in responses, the else clause will never be executed, because the for loop will be entirely skipped. (That is of course after you get passed the error of 'responses' not being assigned: "UnboundLocalError: local variable 'responses' referenced before").
It's likely that it was intended to be something like below instead.
# Address responses being an Unboundlocal when no record is found, then...
if responses:
for record in responses:
...
else:
...
I've posted the Pull Request to resolve this: Fix for issue 488
Metadata
Metadata
Assignees
Labels
No labels