update to not use organizations

This commit is contained in:
sean-m-sullivan 2020-09-01 23:08:15 -05:00
parent d05c7d6cc5
commit a17eedd9fe
2 changed files with 14 additions and 12 deletions

View File

@ -479,13 +479,14 @@ def main():
labels = module.params.get('labels')
if labels is not None:
association_fields['labels'] = []
for item in labels:
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)
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)
notifications_start = module.params.get('notification_templates_started')
if notifications_start is not None:

View File

@ -256,13 +256,14 @@ def main():
labels = module.params.get('labels')
if labels is not None:
association_fields['labels'] = []
for item in labels:
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)
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)
on_change = None
new_spec = module.params.get('survey')