mirror of
https://github.com/ansible/awx.git
synced 2026-03-07 03:31:10 -03:30
add search label by org
This commit is contained in:
@@ -544,13 +544,8 @@ def main():
|
||||
if labels is not None:
|
||||
association_fields['labels'] = []
|
||||
for item in labels:
|
||||
association_fields['labels'].append(module.resolve_name_to_id('labels', item))
|
||||
# Code to use once Issue #7567 is resolved
|
||||
# search_fields = {'name': item}
|
||||
# if organization:
|
||||
# search_fields['organization'] = organization_id
|
||||
# label_id = module.get_one('labels', **{'data': search_fields})
|
||||
# association_fields['labels'].append(label_id)
|
||||
label_id = module.get_one('labels', name_or_id=item, **{'data': search_fields})
|
||||
association_fields['labels'].append(label_id['id'])
|
||||
|
||||
notifications_start = module.params.get('notification_templates_started')
|
||||
if notifications_start is not None:
|
||||
|
||||
@@ -795,13 +795,8 @@ def main():
|
||||
if labels is not None:
|
||||
association_fields['labels'] = []
|
||||
for item in labels:
|
||||
association_fields['labels'].append(module.resolve_name_to_id('labels', item))
|
||||
# Code to use once Issue #7567 is resolved
|
||||
# search_fields = {'name': item}
|
||||
# if organization:
|
||||
# search_fields['organization'] = organization_id
|
||||
# label_id = module.get_one('labels', **{'data': search_fields})
|
||||
# association_fields['labels'].append(label_id)
|
||||
label_id = module.get_one('labels', name_or_id=item, **{'data': search_fields})
|
||||
association_fields['labels'].append(label_id['id'])
|
||||
|
||||
on_change = None
|
||||
new_spec = module.params.get('survey_spec')
|
||||
|
||||
Reference in New Issue
Block a user