Success message and redirect url should also work for 'login require' types webforms

fixes https://github.com/frappe/erpnext/issues/9073
This commit is contained in:
Manas Solanki 2017-06-21 18:36:04 +05:30
parent 501c19b505
commit bb7cfda345

View file

@ -280,19 +280,11 @@ frappe.ready(function() {
callback: function(data) {
if(!data.exc) {
frappe.doc_name = data.message;
if(!frappe.login_required) {
$form.addClass("hide");
$(".comments, .introduction, .page-head").addClass("hide");
scroll(0, 0);
set_message(frappe.success_link, true);
} else {
set_message(__('Saved'));
}
$form.addClass("hide");
$(".comments, .introduction, .page-head").addClass("hide");
scroll(0, 0);
set_message(frappe.success_link, true);
if(frappe.is_new && frappe.login_required) {
// reload page (with ID)
window.location.href = window.location.pathname + "?name=" + frappe.doc_name;
}
if(for_payment && data.message) {
// redirect to payment
window.location.href = data.message;