1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Update tests for tag changes

This commit is contained in:
Jeremy Stretch
2020-06-12 11:33:23 -04:00
parent 7dc4f8d5cc
commit e905a36fb2
7 changed files with 84 additions and 43 deletions

View File

@@ -14,7 +14,14 @@ def post_data(data):
if value is None:
ret[key] = ''
elif type(value) in (list, tuple):
ret[key] = value
if value and hasattr(value[0], 'pk'):
# Value is a list of instances
ret[key] = [v.pk for v in value]
else:
ret[key] = value
elif hasattr(value, 'pk'):
# Value is an instance
ret[key] = value.pk
else:
ret[key] = str(value)