diff --git a/models/forms/RegistrationForm.php b/models/forms/RegistrationForm.php index 8f547597..72918ae1 100644 --- a/models/forms/RegistrationForm.php +++ b/models/forms/RegistrationForm.php @@ -89,6 +89,7 @@ public function registerUser($performValidation = true) } $user = new User(); + $user->username = $this->username; $user->password = $this->password; if ( Yii::$app->getModule('user-management')->useEmailAsLogin ) @@ -119,10 +120,6 @@ public function registerUser($performValidation = true) $user->username = $this->username; } } - else - { - $user->username = $this->username; - } if ( $user->save() )