Skip to content

Commit 68ba352

Browse files
committed
Merge pull request shotgunsoftware#12 from dahiro/master
return_fields of create-call might be None
2 parents 80e5ddc + bb25f24 commit 68ba352

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

shotgun_api3/shotgun.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,9 @@ def create(self, entity_type, data, return_fields=None):
538538

539539
data = copy.deepcopy(data)
540540

541+
if not return_fields:
542+
return_fields = ["id"]
543+
541544
upload_image = None
542545
if 'image' in data:
543546
upload_image = data.pop('image')
@@ -549,7 +552,7 @@ def create(self, entity_type, data, return_fields=None):
549552
"higher, server is %s" % (self.server_caps.version,))
550553
upload_filmstrip_image = data.pop('filmstrip_image')
551554

552-
temp_return_fields = [item for item in return_fields]
555+
temp_return_fields = copy.deepcopy(return_fields)
553556
if upload_image and "image" in temp_return_fields:
554557
temp_return_fields.remove("image")
555558
# end if
@@ -561,7 +564,7 @@ def create(self, entity_type, data, return_fields=None):
561564
params = {
562565
"type" : entity_type,
563566
"fields" : self._dict_to_list(data),
564-
"return_fields" : temp_return_fields or ["id"]
567+
"return_fields" : temp_return_fields
565568
}
566569

567570
record = self._call_rpc("create", params, first=True)

0 commit comments

Comments
 (0)