Skip to content

Commit b9ba80d

Browse files
committed
minor fixes
1 parent f37f318 commit b9ba80d

7 files changed

Lines changed: 25 additions & 11 deletions

File tree

client/polyfill/hidden.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
if (document.documentElement.hidden === undefined) {
2-
document.head.insertAdjacentHTML('<style> [hidden] { display: none } </style>');
2+
document.head.insertAdjacentHTML('beforeEnd', '<style> [hidden] { display: none } </style>');
33
Object.defineProperty(Element.prototype, "hidden", {
44
set: function(value) {
55
this.setAttribute('hidden', value);
@@ -8,4 +8,4 @@ if (document.documentElement.hidden === undefined) {
88
return this.getAttribute('hidden');
99
}
1010
});
11-
}
11+
}

fixture/init/user.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,11 @@ exports.User = [{
88
profileName: 'tester',
99
password: "123456",
1010
verifiedEmail: true
11+
}, {
12+
13+
displayName: "Ilya Kantor",
14+
profileName: 'iliakan',
15+
password: "123456",
16+
verifiedEmail: true
1117
}];
1218

handlers/auth/client/authModal.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ AuthModal.prototype.submitForgotForm = function(form) {
259259
var request = this.request({
260260
method: 'POST',
261261
url: '/auth/forgot',
262-
normalStatuses: [200, 404],
262+
normalStatuses: [200, 404, 403],
263263
body: payload
264264
});
265265

@@ -271,6 +271,8 @@ AuthModal.prototype.submitForgotForm = function(form) {
271271
self.showFormMessage(event.result, 'success');
272272
} else if (this.status == 404) {
273273
self.showFormMessage(event.result, 'error');
274+
} else if (this.status == 403) {
275+
self.showFormMessage(event.result.message || "Действие запрещено.", 'error');
274276
}
275277
});
276278

handlers/auth/controller/forgotRecover.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,18 @@ exports.post = function* (next) {
3939
this.throw(404, 'Ваша ссылка на восстановление недействительна или устарела.');
4040
}
4141

42+
var error = "";
4243
if (!this.request.body.password) {
44+
error = "Пароль не должен быть пустым.";
45+
}
46+
if (this.request.body.password.length < 4) {
47+
error = "Пароль должен содержать минимум 4 символа.";
48+
}
4349

50+
if (error) {
4451
this.body = this.render('forgot-recover', {
4552
passwordResetToken: passwordResetToken,
46-
error: "Пароль не должен быть пустым."
53+
error: error
4754
});
4855

4956
return;

handlers/auth/lib/mustNotBeAuthenticated.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ module.exports = function*(next) {
33
if (!this.isAuthenticated()) {
44
yield* next;
55
} else {
6-
this.throw(403, 'Это действие доступно только для неавторизованных посетителей');
6+
this.throw(403, 'Это действие доступно только для неавторизованных посетителей.');
77
}
88
};

handlers/courses/lib/sendOrderInvites.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,10 @@ function* createInvites(order) {
6161

6262
function* sendInvites(invites) {
6363

64-
for (var i = 0; i < invites.length; i++) {
65-
var invite = invites[i];
66-
log.debug("send invite", invite);
67-
yield* sendInvite(invite);
68-
}
64+
// send invites in parallel, for speed
65+
yield invites.map(function(invite) {
66+
return sendInvite(invite);
67+
});
6968

7069
}
7170

handlers/tutorial/templates/frontpage.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ extends /layouts/main
22

33
block append variables
44
- var layout_main_class = "main_width-limit-wide"
5-
- var comments = env.NODE_ENV == 'development'
5+
- var comments = (env.NODE_ENV == 'development')
66
- var layout_header_class = "main__header_center"
77

88
block content

0 commit comments

Comments
 (0)