chore: file name changed for exported issues (#1865)

Co-authored-by: NarayanBavisetti <narayan311@gmail.com>
This commit is contained in:
Bavisetti Narayan 2023-08-15 10:19:17 -04:00 committed by GitHub
parent df46a45afc
commit 07717e9a93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,7 +4,6 @@ import io
import json import json
import boto3 import boto3
import zipfile import zipfile
from datetime import datetime
# Django imports # Django imports
from django.conf import settings from django.conf import settings
@ -46,11 +45,9 @@ def create_xlsx_file(data):
workbook = Workbook() workbook = Workbook()
sheet = workbook.active sheet = workbook.active
for row in data: for row in data:
sheet.append(row) sheet.append(row)
xlsx_buffer = io.BytesIO() xlsx_buffer = io.BytesIO()
workbook.save(xlsx_buffer) workbook.save(xlsx_buffer)
xlsx_buffer.seek(0) xlsx_buffer.seek(0)
@ -75,7 +72,7 @@ def upload_to_s3(zip_file, workspace_id, token_id):
aws_secret_access_key=settings.AWS_SECRET_ACCESS_KEY, aws_secret_access_key=settings.AWS_SECRET_ACCESS_KEY,
config=Config(signature_version="s3v4"), config=Config(signature_version="s3v4"),
) )
file_name = f"{workspace_id}/issues-{datetime.now().date()}.zip" file_name = f"{workspace_id}/issues-{token_id}.zip"
s3.upload_fileobj( s3.upload_fileobj(
zip_file, zip_file,