mirror of
https://github.com/camptocamp/odoo-cloud-platform.git
synced 2026-06-24 02:08:36 +00:00
attachment_s3: multi-tenancy use db name in bucket
Adds the possibility to insert `{db}` placeholder in the bucket name
that will be replaced by the database name to form a unique bucket
name per database.
This commit is contained in:
@@ -55,6 +55,8 @@ class IrAttachment(models.Model):
|
||||
access_key = os.environ.get('AWS_ACCESS_KEY_ID')
|
||||
secret_key = os.environ.get('AWS_SECRET_ACCESS_KEY')
|
||||
bucket_name = name or os.environ.get('AWS_BUCKETNAME')
|
||||
# replaces {db} by the database name to handle multi-tenancy
|
||||
bucket_name.format(db=self.env.cr.dbname)
|
||||
|
||||
params = {
|
||||
'aws_access_key_id': access_key,
|
||||
|
||||
Reference in New Issue
Block a user