name field: remove failure for blank name, and don't say your name looks good when you haven't entered anything

This commit is contained in:
Neil Lalonde 2014-10-29 16:10:21 -04:00
parent 62a6b3ce19
commit 62fa3775f2

View File

@ -70,20 +70,13 @@ export default DiscourseController.extend(ModalFunctionality, {
return I18n.t('user.password.instructions', {count: Discourse.SiteSettings.min_password_length});
}.property(),
// Validate the name
// Validate the name. It's not required.
nameValidation: function() {
// If blank, fail without a reason
if (this.blank('accountName')) return Discourse.InputValidation.create({ failed: true });
if (this.get('accountPasswordConfirm') === 0) {
this.fetchConfirmationValue();
}
// Looks good!
return Discourse.InputValidation.create({
ok: true,
reason: I18n.t('user.name.ok')
});
return Discourse.InputValidation.create({ok: true});
}.property('accountName'),
// Check the email address