forked from github/plane
fix: changed migration and added public s3
This commit is contained in:
parent
2628890068
commit
4ce3fa356a
@ -106,14 +106,14 @@ def upload_to_s3(zip_file, workspace_id, token_id, slug):
|
|||||||
)
|
)
|
||||||
s3.upload_fileobj(
|
s3.upload_fileobj(
|
||||||
zip_file,
|
zip_file,
|
||||||
settings.AWS_S3_BUCKET_NAME,
|
settings.AWS_PUBLIC_STORAGE_BUCKET_NAME,
|
||||||
file_name,
|
file_name,
|
||||||
ExtraArgs={"ACL": "public-read", "ContentType": "application/zip"},
|
ExtraArgs={"ACL": "public-read", "ContentType": "application/zip"},
|
||||||
)
|
)
|
||||||
|
|
||||||
presigned_url = s3.generate_presigned_url(
|
presigned_url = s3.generate_presigned_url(
|
||||||
"get_object",
|
"get_object",
|
||||||
Params={"Bucket": settings.AWS_S3_BUCKET_NAME, "Key": file_name},
|
Params={"Bucket": settings.AWS_PUBLIC_STORAGE_BUCKET_NAME, "Key": file_name},
|
||||||
ExpiresIn=expires_in,
|
ExpiresIn=expires_in,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -44,6 +44,6 @@ def delete_old_s3_link():
|
|||||||
if settings.DOCKERIZED and settings.USE_MINIO:
|
if settings.DOCKERIZED and settings.USE_MINIO:
|
||||||
s3.delete_object(Bucket=settings.AWS_STORAGE_BUCKET_NAME, Key=file_name)
|
s3.delete_object(Bucket=settings.AWS_STORAGE_BUCKET_NAME, Key=file_name)
|
||||||
else:
|
else:
|
||||||
s3.delete_object(Bucket=settings.AWS_S3_BUCKET_NAME, Key=file_name)
|
s3.delete_object(Bucket=settings.AWS_PUBLIC_STORAGE_BUCKET_NAME, Key=file_name)
|
||||||
|
|
||||||
ExporterHistory.objects.filter(id=exporter_id).update(url=None)
|
ExporterHistory.objects.filter(id=exporter_id).update(url=None)
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
# Generated by Django 4.2.3 on 2023-09-21 14:16
|
# Generated by Django 4.2.3 on 2023-09-21 14:16
|
||||||
|
|
||||||
import boto3
|
import boto3
|
||||||
import botocore
|
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
|
||||||
@ -31,7 +30,7 @@ def move_s3_objects(apps, schema_editor):
|
|||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
dependencies = [
|
dependencies = [
|
||||||
("db", "0047_auto_20230921_0758"),
|
("db", "0045_issueactivity_epoch_workspacemember_issue_props_and_more"),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
Loading…
Reference in New Issue
Block a user