try/except statement added.

fixes #472
This commit is contained in:
Antoine Nguyen
2013-08-28 21:50:30 +02:00
parent 0b28614151
commit 366371dc59
+4 -1
View File
@@ -106,7 +106,10 @@ def submitfilter(request, setname, okmsg, tplname, tplctx, update=False, sc=None
fset.updatefilter(request.POST["oldname"],
fltname, conditions, actions,
match_type)
sc.pushscript(fset.name, str(fset))
try:
sc.pushscript(fset.name, str(fset))
except SieveClientError as e:
return ajax_response(request, "ko", respmsg=str(e))
return ajax_response(request, respmsg=okmsg, ajaxnav=True)
tplctx = build_filter_ctx(tplctx, form)
return ajax_response(request, status="ko", template=tplname, **tplctx)