Commit 1901fd17 authored by marcel's avatar marcel
Browse files

Fix password reset in vispa.js, do not set status code in ajax tool.

parent 05178ff5
......@@ -281,8 +281,7 @@ Your Vispa-Team!""" % (name, link)
# create the mail content
subject = vispa.config("web", "forgot.subject", "Your VISPA password")
url = vispa.config("web", "password_url",
"http://localhost:4282/vispa/password")
url = vispa.config("web", "password_url")
link = os.path.join(url, hash)
content = """Hi %s!
......
......@@ -323,15 +323,17 @@ define([
});
$(".vispa-nav #reset-password").click(function(event) {
self.POST(vispa.url.dynamic("/ajax/forgotpassword"), {username: self.args.user.name})
.done(function() {
var header = "<i class='glyphicon glyphicon-envelope'></i> Success";
vispa.messenger.alert("Further instructions have been sent to your mail address!", {
header: header
});
}).fail(function(res) {
var header = "<i class='glyphicon glyphicon-warning-sign'></i> Error";
vispa.messenger.alert(res.responseText, {header: header});
self.POST(vispa.url.dynamic("/ajax/forgotpassword"), {username: self.args.user.name},
function(err) {
if (err) {
var header = "<i class='glyphicon glyphicon-warning-sign'></i> Error";
vispa.messenger.alert(err.message, {header: header});
} else {
var header = "<i class='glyphicon glyphicon-envelope'></i> Success";
vispa.messenger.alert("Further instructions have been sent to your mail address!", {
header: header
});
}
});
event.preventDefault();
});
......
......@@ -84,7 +84,7 @@ class AjaxTool(cherrypy.Tool):
# changes to the response object
response.headers["Content-Type"] = "application/json;charset=utf-8"
response.status = result["code"]
#response.status = result["code"]
# json encode the result
result = '%s, "data": %s}' % (json.dumps(result)[:-1], data)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment