mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-02 06:30:19 -07:00
* bitwarden: Fix KeyError in search_field (#8549) * Update changelogs/fragments/8557-fix-bug-with-bitwarden.yml Co-authored-by: Felix Fontein <felix@fontein.de> --------- Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
70c8042c99
commit
6e0142fe3a
2 changed files with 5 additions and 2 deletions
|
@ -174,8 +174,9 @@ class Bitwarden(object):
|
|||
else:
|
||||
initial_matches = [initial_matches]
|
||||
|
||||
# Filter to only include results from the right field.
|
||||
return [item for item in initial_matches if not search_value or item[search_field] == search_value]
|
||||
# Filter to only include results from the right field, if a search is requested by value or field
|
||||
return [item for item in initial_matches
|
||||
if not search_value or not search_field or item.get(search_field) == search_value]
|
||||
|
||||
def get_field(self, field, search_value, search_field="name", collection_id=None, organization_id=None):
|
||||
"""Return a list of the specified field for records whose search_field match search_value
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue