mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-18 16:02:10 +00:00
fix: handle missing storage key in S3Object for write_s3_file
Use .get("storage") instead of direct key access to prevent KeyError
when s3object doesn't contain the optional storage field.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -975,7 +975,7 @@ class Windmill:
|
||||
).json()
|
||||
except Exception as e:
|
||||
raise Exception("Could not write file to S3") from e
|
||||
return S3Object(s3=response["file_key"], storage=s3object["storage"])
|
||||
return S3Object(s3=response["file_key"], storage=s3object.get("storage") if s3object else None)
|
||||
|
||||
def sign_s3_objects(self, s3_objects: list[S3Object | str]) -> list[S3Object]:
|
||||
"""Sign S3 objects for use by anonymous users in public apps.
|
||||
|
||||
Reference in New Issue
Block a user