chg: localize errors for accepting terms / gdpr

This commit is contained in:
Tobi Schäfer 2020-05-24 22:28:04 +02:00
parent 751d1d2523
commit 9fc91c221d

View file

@ -356,11 +356,18 @@ Members.prototype.add_action = function() {
}
Members.prototype.accept_action = function() {
if (!session.data.login) res.redirect(this._parent.href());
if (!session.data.login) { res.redirect(this._parent.href()); }
if (req.postParams.accept) {
try {
if (root.termsStory && !req.postParams.terms) throw Error('Please accept the terms and conditions.');
if (root.privacyStory && !req.postParams.privacy) throw Error('Please accept the data privacy statement.');
if (root.termsStory && !req.postParams.terms) {
throw Error(gettext('Please accept the terms and conditions.'));
}
if (root.privacyStory && !req.postParams.privacy) {
throw Error(gettext('Please accept the data privacy statement.'));
}
User.login(session.data.login);
session.data.login = null;
session.user.accepted = Date.now();