Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError in bind_user with invalid username #61

Closed
Nothing4You opened this issue Feb 21, 2019 · 1 comment
Closed

AttributeError in bind_user with invalid username #61

Nothing4You opened this issue Feb 21, 2019 · 1 comment

Comments

@Nothing4You
Copy link

When passing an invalid username I'm getting an exception rather than None:

Traceback (most recent call last):
  File "/Users/$USER/.local/share/virtualenvs/myproject-A47Vo0O9/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
    response = self.full_dispatch_request()
  File "/Users/$USER/.local/share/virtualenvs/myproject-A47Vo0O9/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/Users/$USER/.local/share/virtualenvs/myproject-A47Vo0O9/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/Users/$USER/.local/share/virtualenvs/myproject-A47Vo0O9/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
    raise value
  File "/Users/$USER/.local/share/virtualenvs/myproject-A47Vo0O9/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Users/$USER/.local/share/virtualenvs/myproject-A47Vo0O9/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/Users/$USER/dev/myproject/myproject.py", line 98, in login
    test = ldap.bind_user(user, passwd)
  File "/Users/$USER/.local/share/virtualenvs/myproject-A47Vo0O9/lib/python3.6/site-packages/flask_simpleldap/__init__.py", line 147, in bind_user
    user_dn = self.get_object_details(user=username, dn_only=True)
  File "/Users/$USER/.local/share/virtualenvs/myproject-A47Vo0O9/lib/python3.6/site-packages/flask_simpleldap/__init__.py", line 197, in get_object_details
    for k, v in list(records[0][1].items()):
AttributeError: 'list' object has no attribute 'items'
@alexferl
Copy link
Owner

Fixed in v1.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants