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)