Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions shotgun_api3/shotgun.py
100755 → 100644
Original file line numberDiff line numberDiff line change
Expand Up@@ -1318,8 +1318,9 @@ def set_up_auth_cookie(self):
def get_attachment_download_url(self, attachment):
"""Returns the URL for downloading provided Attachment.

:param attachment: (mixed) If type is an int, construct url to download
Attachment with id from Shotgun.
:param attachment: (mixed) If type is a str convert to int.
If type is an int, construct url to download Attachment with id from
Shotgun.
If type is a dict, and a url key is present, use that url.
If type is a dict, and url key is not present, check if we have
an id and type keys and the type is 'Attachment' in which case we
Expand All@@ -1335,6 +1336,8 @@ def get_attachment_download_url(self, attachment):
attachment_id = None
if isinstance(attachment, int):
attachment_id = attachment
elif isinstance(attachment, str):
attachment_id = int(attachment)
elif isinstance(attachment, dict):
try:
url = attachment['url']
Expand Down