Skip to content

Problem with scenario when conn.response contains attributes dict with {'dn':[]} inside #35

@DamianSkrzypczak

Description

@DamianSkrzypczak

Hello,

in devpi_ldap/main.py/line 175 there is:
if any(attribute_name in x.get('attributes', {}) for x in conn.response):

but I had scenario when conn.response returned dict {attributes:{'dn':[]}} and attribute_name was set to "dn"
which, I guess, should result with transition to line 181 elif attribute_name in ('dn', 'distinguishedName'):

Maybe something like this should solve this problem but I don't think it's beautiful solution, rather hotfix suggestion (I'm sorry if this looks insolent, I'm always try to offer some solution when I found problem):
if any(attribute_name in x.get('attributes', {}) and x.get('attributes', {})[attribute_name] for x in conn.response):

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions