fixing last of anti-pattern issues

This commit is contained in:
Navan Chauhan 2020-07-07 12:49:00 +05:30
parent 3b6482cb0a
commit 8debf21607
2 changed files with 1 additions and 2 deletions

View File

@ -69,7 +69,6 @@ f = os.path.join(cd,"static/uploads")
#c = os.path.join(f,"configs",config)
print(f)
import tempfile
from shutil import copy
from shutil import make_archive
with tempfile.TemporaryDirectory() as directory:

View File

@ -28,7 +28,7 @@ def email(compressedFile):
msg.attach(MIMEText(body, 'plain'))
filename = "Curie_Web_Results_Job_ID_" + str(jobID) + ".zip"
p = MIMEBase('application', 'octet-stream')
with open((str(zi) + ".zip"), "rb") as attachment:
with open((str(compressedFile) + ".zip"), "rb") as attachment:
p.set_payload((attachment).read())
encoders.encode_base64(p)
p.add_header('Content-Disposition', "attachment; filename= %s" % filename)