Touching up to missing sport of get_one returning multiple params

This commit is contained in:
John Westcott IV 2020-09-08 13:38:44 -04:00
parent c2cfaec7d1
commit 4c0e288fee
2 changed files with 3 additions and 3 deletions

View File

@ -453,7 +453,7 @@ def main():
new_fields['inventory'] = module.resolve_name_to_id('inventories', inventory)
if project is not None:
if organization_id is not None:
project_data, project = module.get_one('projects', name_or_id=project, **{
project_data = module.get_one('projects', name_or_id=project, **{
'data': {
'organization': organization_id,
}

View File

@ -175,7 +175,7 @@ def main():
{% endfor %}
# Attempt to look up an existing item based on the provided data
existing_item, name = module.get_one('{{ item_type }}', name_or_id={{ name_option }}, **{
existing_item = module.get_one('{{ item_type }}', name_or_id={{ name_option }}, **{
'data': {
{% if 'organization' in item['json']['actions']['POST'] and item['json']['actions']['POST']['organization']['type'] == 'id' %}
'organization': org_id,
@ -194,7 +194,7 @@ def main():
new_fields = {}
{% for option in item['json']['actions']['POST'] %}
{% if option == name_option %}
new_fields['{{ name_option }}'] = new_{{ name_option }} if new_{{ name_option }} else {{ name_option }}
new_fields['{{ name_option }}'] = new_{{ name_option }} if new_{{ name_option }} else (module.get_item_name(existing_item) if existing_item else {{ name_option }}t)
{% else %}
if {{ option }} is not None:
{% if item['json']['actions']['POST'][option]['type'] == 'id' %}