Merge branch 'develop' into feature/django2
This commit is contained in:
@@ -1270,6 +1270,7 @@ def new_workout_from_file(r, f2,
|
||||
message = None
|
||||
try:
|
||||
fileformat = get_file_type(f2)
|
||||
print(fileformat,'aa')
|
||||
except IOError:
|
||||
os.remove(f2)
|
||||
message = "Rowsandall could not process this file. The extension is supported but the file seems corrupt. Contact info@rowsandall.com if you think this is incorrect."
|
||||
@@ -1327,7 +1328,13 @@ def new_workout_from_file(r, f2,
|
||||
# worth supporting
|
||||
if fileformat == 'unknown':
|
||||
message = "We couldn't recognize the file type"
|
||||
f4 = f2[:-5]+'a'+f2[-5:]
|
||||
extension = os.path.splitext(f2)[1]
|
||||
filename = os.path.splitext(f2)[0]
|
||||
if extension == '.gz':
|
||||
filename = os.path.splitext(filename)[0]
|
||||
extension2 = os.path.splitext(filename)[1]+extension
|
||||
extension = extension2
|
||||
f4 = filename+'a'+extension
|
||||
copyfile(f2,f4)
|
||||
job = myqueue(queuehigh,
|
||||
handle_sendemail_unrecognized,
|
||||
@@ -1335,6 +1342,9 @@ def new_workout_from_file(r, f2,
|
||||
r.user.email)
|
||||
|
||||
return (0, message, f2)
|
||||
if fileformat == 'att':
|
||||
# email attachment which can safely be ignored
|
||||
return (0, '', f2)
|
||||
|
||||
# handle non-Painsled by converting it to painsled compatible CSV
|
||||
if (fileformat != 'csv'):
|
||||
|
||||
Reference in New Issue
Block a user