Skip to content

Commit

Permalink
Upgrade boto to last version
Browse files Browse the repository at this point in the history
Related GH issue : boto/boto3#4401
  • Loading branch information
mlvernay committed Jan 23, 2025
1 parent 38e6e31 commit ffc7b8f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .isort.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[settings]
known_third_party = Levenshtein,admin_auto_filters,admin_two_factor,autoslug,boto3,celery,colorama,corsheaders,deepl,dj_static,django,django_better_admin_arrayfield,django_registration,django_summernote,environ,factory,faker,frictionless,fuzz,fuzzywuzzy,geopy,ijson,import_export,magic_profanity,modeltranslation,outscraper,pandas,phonenumbers,pytest,pytest_factoryboy,requests,rest_framework,rest_framework_api_key,rest_framework_gis,reversion,schedule,scrapfly,sentry_sdk,sib_api_v3_sdk,six,splinter,stdnum,waffle
known_third_party = Levenshtein,admin_auto_filters,admin_two_factor,autoslug,boto3,botocore,celery,colorama,corsheaders,deepl,dj_static,django,django_better_admin_arrayfield,django_registration,django_summernote,environ,factory,faker,frictionless,fuzz,fuzzywuzzy,geopy,ijson,import_export,magic_profanity,modeltranslation,outscraper,pandas,phonenumbers,pytest,pytest_factoryboy,requests,rest_framework,rest_framework_api_key,rest_framework_gis,reversion,schedule,scrapfly,sentry_sdk,sib_api_v3_sdk,six,splinter,stdnum,waffle
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ inflection = "*" # Used by DRF but not in its dependencies
django-admin-two-factor = "*"
django-csp = "*"
colorama = "*"
boto3 = "1.35.99"
boto3 = "*"
magic-profanity = "*"
django-summernote = "*"

Expand Down
20 changes: 10 additions & 10 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion erp/export/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from datetime import datetime, timezone

import boto3
from botocore.config import Config
from celery import shared_task
from django.conf import settings
from django.http import QueryDict
Expand Down Expand Up @@ -32,7 +33,11 @@ def generate_csv_file(query_params, user_email, username):
bucket_name = settings.S3_EXPORT_BUCKET_NAME
file_name = f"export_{now}_{user_email_hash}.csv"

s3 = boto3.client("s3", endpoint_url=settings.S3_EXPORT_BUCKET_ENDPOINT_URL)
s3 = boto3.client(
"s3",
endpoint_url=settings.S3_EXPORT_BUCKET_ENDPOINT_URL,
config=Config(request_checksum_calculation="when_required", response_checksum_validation="when_required"),
)
s3.put_object(Bucket=bucket_name, Key=file_name, Body=csv_buffer.getvalue(), ContentType="text/csv")

file_url = s3.generate_presigned_url(
Expand Down

0 comments on commit ffc7b8f

Please sign in to comment.