mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-17 05:41:25 +02:00
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:
@@ -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);
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user