Few fixes:

* Take care of special characters (fixes #406)
* Don't try to select a non existing object (fixes #411)
This commit is contained in:
Antoine Nguyen
2013-04-27 12:15:09 +02:00
parent fbae30fcab
commit 538c0a406f
2 changed files with 9 additions and 6 deletions
@@ -147,7 +147,7 @@ function removefs(evt) {
send_command($(this).attr("href"), function(response) {
var $curfset = $("#curfset");
$curfset.find("option[value=" + curscript + "]").remove();
$curfset.find("option[value='" + curscript + "']").remove();
history.baseurl(response.newfs, 1);
});
}
@@ -216,7 +216,7 @@ function filterset_created(data) {
curfset.append(option);
curfset.attr("value", name);
if ($("#id_active").prop("checked", true)) {
if (data.active) {
curfset.find("option").each(function(index, element) {
var $element = $(element);
+7 -4
View File
@@ -201,10 +201,13 @@ def new_filters_set(request, tplname="common/generic_modal_form.html"):
except SieveClientError, e:
error = str(e)
else:
return ajax_response(request,
ajaxnav=True,
url=form.cleaned_data["name"],
respmsg=_("Filters set created"))
return ajax_simple_response({
"status": "ok",
"url": form.cleaned_data["name"],
"active": form.cleaned_data["active"],
"respmsg": _("Filters set created")
})
ctx["form"] = form
ctx["error"] = error
return ajax_response(request, status="ko", template=tplname, **ctx)