Skip to content

Commit fdb1f6e

Browse files
author
KP
committed
fix return value for update() method to return dict instead of list.
1 parent f616dfd commit fdb1f6e

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

README.mdown

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ Some useful direct links within this section are below:
2323
* [Reference: Filter Syntax](https://github.com/shotgunsoftware/python-api/wiki/Reference%3A-Filter-Syntax)
2424

2525
## Changelog
26-
**v3.0.6 - 2010 Jan 25**
26+
**v3.0.7 - 2011 Apr 04**
27+
28+
+ fix: update() method should return a dict object not a list
29+
30+
**v3.0.6 - 2011 Jan 25**
2731

2832
+ optimization: don't request paging_info unless required (and server support is available)
2933

shotgun_api3.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
# https://support.shotgunsoftware.com/forums/48807-developer-api-info
3333
# ---------------------------------------------------------------------------------------------
3434

35-
__version__ = "3.0.6"
35+
__version__ = "3.0.7"
3636

3737
# ---------------------------------------------------------------------------------------------
3838
# SUMMARY
@@ -51,14 +51,16 @@
5151
- make file fields an http link to the file
5252
- add logging functionality
5353
- add scrubbing to text data sent to server to make sure it is all valid unicode
54-
- support removing thumbnails / files (can only create or replace them now)
5554
"""
5655

5756
# ---------------------------------------------------------------------------------------------
5857
# CHANGELOG
5958
# ---------------------------------------------------------------------------------------------
6059
"""
61-
+v3.0.6 - 2010 Jan 25
60+
+v3.0.7 - 2011 Apr 04
61+
+ fix: update() method should return a dict object not a list
62+
63+
+v3.0.6 - 2011 Jan 25
6264
+ optimization: don't request paging_info unless required (and server support is available)
6365
6466
+v3.0.5 - 2010 Dec 20
@@ -370,7 +372,7 @@ def find(self, entity_type, filters, fields=None, order=None, filter_operator=No
370372

371373
filters = new_filters
372374
elif filter_operator:
373-
raise ShotgunError("Deprecated: Use of filter_operator for find() is not valid any more. See the documention on find()")
375+
raise ShotgunError("Deprecated: Use of filter_operator for find() is not valid in this context. See the documention on find()")
374376

375377
if retired_only:
376378
return_only = 'retired'
@@ -549,8 +551,8 @@ def update(self, entity_type, entity_id, data):
549551
args["fields"].append( {"field_name":f,"value":v} )
550552

551553
resp = self._api3.update(args)
552-
records = self._inject_field_values([resp["results"]])
553-
return records
554+
record = self._inject_field_values([resp["results"]])[0]
555+
return record
554556

555557
def delete(self, entity_type, entity_id):
556558
"""

0 commit comments

Comments
 (0)