Still tweaking redirect after delete/cancel

This commit is contained in:
Tobi Schäfer 2021-04-04 14:08:12 +02:00
parent 34f61ea7d9
commit 1e78e4da64

View file

@ -186,8 +186,9 @@ HopObject.prototype.delete_action = function() {
var parent = this._parent;
var type = this._prototype;
var url = this.constructor.remove.call(this, req.postParams) || parent.href();
res.message = gettext('{0} was successfully deleted.', gettext(type));
res.redirect(User.getLocation() || url);
res.redirect(url);
} catch(ex) {
redirectUrl = session.data.referer;
res.message = ex;
@ -195,8 +196,13 @@ HopObject.prototype.delete_action = function() {
}
}
if (req.data.http_get_remainder === 'safemode') { res.skinpath = [app.dir]; }
if (!res.data.action) { res.data.action = this.href(req.action); }
if (req.data.http_get_remainder === 'safemode') {
res.skinpath = [app.dir];
}
if (!res.data.action) {
res.data.action = this.href(req.action);
}
res.data.title = gettext('Confirm Deletion');
session.data.location = redirectUrl;