From ebce342fcedb5472e37037b0fdd0c8061ac790a7 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Wed, 27 Sep 2017 09:03:16 +0200 Subject: [PATCH] slight improvements in email command parsing --- rowers/management/commands/processemail.py | 1 + rowers/uploads.py | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/rowers/management/commands/processemail.py b/rowers/management/commands/processemail.py index c15262d1..c20e2b7c 100644 --- a/rowers/management/commands/processemail.py +++ b/rowers/management/commands/processemail.py @@ -139,6 +139,7 @@ class Command(BaseCommand): except: pass + # remove attachment if donotdelete == 0: a.delete() diff --git a/rowers/uploads.py b/rowers/uploads.py index b3a3d5b4..d5405a60 100644 --- a/rowers/uploads.py +++ b/rowers/uploads.py @@ -109,11 +109,12 @@ def upload_options(body): yml = (yaml.load(body)) try: for key, value in yml.iteritems(): - if key == 'sync' or key == 'synchronization': + lowkey = key.lower() + if lowkey == 'sync' or lowkey == 'synchronization': uploadoptions = getsyncoptions(uploadoptions,value) - if key == 'chart' or key == 'static' or key == 'plot': + if lowkey == 'chart' or lowkey == 'static' or lowkey == 'plot': uploadoptions = getplotoptions(uploadoptions,value) - if 'priva' in key: + if 'priva' in lowkey: uploadoptions = getboolean(uploadoptions,value,'makeprivate') except AttributeError: pass @@ -125,7 +126,10 @@ def upload_options(body): pm.column+1, )+strpm return {'error':pbm} - + + if uploadoptions == {}: + uploadoptions['message'] = 'No parsing issue. No valid commands detected' + return uploadoptions def make_plot(r,w,f1,f2,plottype,title,imagename='',plotnr=0):