Skip to content

Commit

Permalink
make bucket name dynamical in migration file
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentporte committed Dec 19, 2024
1 parent fbc6a4b commit 1b1606c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lacommunaute/partner/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import machina.models.fields
import storages.backends.s3
from django.conf import settings
from django.db import migrations, models

import lacommunaute.utils.validators
Expand Down Expand Up @@ -35,7 +36,9 @@ class Migration(migrations.Migration):
"logo",
models.ImageField(
help_text="1200x600 recommandé",
storage=storages.backends.s3.S3Storage(bucket_name="private-bucket", file_overwrite=False),
storage=storages.backends.s3.S3Storage(
bucket_name=settings.AWS_STORAGE_BUCKET_NAME, file_overwrite=False
),
upload_to="logos/",
validators=[lacommunaute.utils.validators.validate_image_size],
),
Expand Down

0 comments on commit 1b1606c

Please sign in to comment.