Remove force_str() in upload.py.

This commit is contained in:
Steve Howell 2017-11-04 12:01:46 -07:00 committed by Tim Abbott
parent 531a3ee9de
commit 3158ed01bf
1 changed files with 2 additions and 2 deletions

View File

@ -186,7 +186,7 @@ def upload_image_to_s3(
conn = S3Connection(settings.S3_KEY, settings.S3_SECRET_KEY) conn = S3Connection(settings.S3_KEY, settings.S3_SECRET_KEY)
bucket = get_bucket(conn, bucket_name) bucket = get_bucket(conn, bucket_name)
key = Key(bucket) key = Key(bucket)
key.key = force_str(file_name) key.key = file_name
key.set_metadata("user_profile_id", str(user_profile.id)) key.set_metadata("user_profile_id", str(user_profile.id))
key.set_metadata("realm_id", str(user_profile.realm_id)) key.set_metadata("realm_id", str(user_profile.realm_id))
@ -240,7 +240,7 @@ def get_file_info(request, user_file):
def get_signed_upload_url(path): def get_signed_upload_url(path):
# type: (Text) -> Text # type: (Text) -> Text
conn = S3Connection(settings.S3_KEY, settings.S3_SECRET_KEY) conn = S3Connection(settings.S3_KEY, settings.S3_SECRET_KEY)
return conn.generate_url(15, 'GET', bucket=settings.S3_AUTH_UPLOADS_BUCKET, key=force_str(path)) return conn.generate_url(15, 'GET', bucket=settings.S3_AUTH_UPLOADS_BUCKET, key=path)
def get_realm_for_filename(path): def get_realm_for_filename(path):
# type: (Text) -> Optional[int] # type: (Text) -> Optional[int]