From 2e21979e73457514ea9d8861501438a0043a45d0 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Fri, 9 Dec 2016 08:10:20 +0100 Subject: [PATCH] Bug fix --- rowers/tasks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rowers/tasks.py b/rowers/tasks.py index 0f84c711..8a7b2019 100644 --- a/rowers/tasks.py +++ b/rowers/tasks.py @@ -93,8 +93,8 @@ def handle_sendemailcsv(first_name,last_name,email,csvfile): if os.path.isfile(csvfile): email.attach_file(csvfile) else: - csvfile2 = csvfile[:-3] - with gzip.open(csvfile,'rb') as f_in, open(csvfile2,'wb') as f_out: + csvfile2 = csvfile + with gzip.open(csvfile+'.gz','rb') as f_in, open(csvfile2,'wb') as f_out: shutil.copyfileobj(f_in, f_out) email.attach_file(csvfile2)