Skip to content

Commit

Permalink
add file extension to downloaded image
Browse files Browse the repository at this point in the history
  • Loading branch information
mwvolo committed Oct 15, 2024
1 parent f38dc25 commit a0dc02f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions salesforce/management/commands/update_partners.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,10 @@ def handle(self, *args, **options):
try:
document_id = document_query['records'][0]['ContentDocumentId']

version_query = sf.query("SELECT Id, CreatedDate, Title, VersionData FROM ContentVersion WHERE Title LIKE '%public_logo%' AND ContentDocumentId = '{}' ORDER BY CreatedDate DESC".format(document_id))
version_query = sf.query("SELECT Id, CreatedDate, Title, FileExtension, VersionData FROM ContentVersion WHERE Title LIKE '%public_logo%' AND ContentDocumentId = '{}' ORDER BY CreatedDate DESC".format(document_id))
content_version = version_query['records'][0]
if content_version:
content_title = content_version['Title']
content_title = "{}.{}".format(content_version['Title'], content_version['FileExtension'])
file_url = "https://openstax.my.salesforce.com" + content_version['VersionData']

headers = {
Expand Down

0 comments on commit a0dc02f

Please sign in to comment.