chg: localize errors for accepting terms / gdpr
This commit is contained in:
parent
751d1d2523
commit
9fc91c221d
1 changed files with 10 additions and 3 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue