diff --git a/scm-ui/src/users/components/UserForm.js b/scm-ui/src/users/components/UserForm.js index ba1e2f6753..9e04160d3d 100644 --- a/scm-ui/src/users/components/UserForm.js +++ b/scm-ui/src/users/components/UserForm.js @@ -63,14 +63,19 @@ class UserForm extends React.Component { isValid = () => { const user = this.state.user; + + const createUserIsValid = !this.props.user + ? this.state.nameValidationError || + this.isFalsy(user.name) || + !this.state.passwordValid + : false; + return !( - this.state.nameValidationError || + createUserIsValid || this.state.mailValidationError || this.state.displayNameValidationError || - this.isFalsy(user.name) || this.isFalsy(user.displayName) || - this.isFalsy(user.mail) || - !this.state.passwordValid + this.isFalsy(user.mail) ); };