Skip to content

Commit

Permalink
Issue #420: Fix warning with user-create (#421)
Browse files Browse the repository at this point in the history
  • Loading branch information
yorkshire-pudding authored Aug 15, 2024
1 parent c97ff90 commit e784ac4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ execute permissions have not been added to the file.
not exist.
- Unhandled Warning if argument for 'cache-clear' wasn't in the list.
- Error if config-set used to set a new configuration item.
- Unhandled Warning on `user-create` with mail option.

## [1.x-1.0.2] - 2024-05-23

Expand Down
6 changes: 5 additions & 1 deletion commands/user.bee.inc
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,11 @@ function user_create_bee_callback($arguments, $options) {
bee_message(bt("Email address '!mail' is not valid.", array('!mail' => $options['mail'])), 'error');
return;
}
if (user_load_by_mail($options['mail'])->mail == $options['mail']) {

// Check if a user exists with that email address.
$user_mail = user_load_by_mail($options['mail']);
$user_mail_exists = !$user_mail ? FALSE : TRUE;
if ($user_mail_exists) {
bee_message(bt("A user account with mail '!mail' already exists.", array(
'!mail' => $options['mail'],
)), 'error');
Expand Down

0 comments on commit e784ac4

Please sign in to comment.