diff options
author | Martin Kraft <martinkraft@gmail.com> | 2018-05-16 14:45:46 -0400 |
---|---|---|
committer | Martin Kraft <martinkraft@gmail.com> | 2018-05-16 14:45:46 -0400 |
commit | f1a830ce9aea87fbeab7e54a6b2b56423e5fed45 (patch) | |
tree | 613bb2cb29cca3016d6b6ac75602aad26303f4f7 /cmd/commands/user.go | |
parent | 16bbbc2abca7c2e5dc2e6876da0dba2bae9eed04 (diff) | |
parent | 02f8c18f40cd0e973e4c75b751e8fcbbbd019728 (diff) | |
download | chat-f1a830ce9aea87fbeab7e54a6b2b56423e5fed45.tar.gz chat-f1a830ce9aea87fbeab7e54a6b2b56423e5fed45.tar.bz2 chat-f1a830ce9aea87fbeab7e54a6b2b56423e5fed45.zip |
Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-2
Diffstat (limited to 'cmd/commands/user.go')
-rw-r--r-- | cmd/commands/user.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cmd/commands/user.go b/cmd/commands/user.go index da3fb454b..7397cfb2e 100644 --- a/cmd/commands/user.go +++ b/cmd/commands/user.go @@ -422,6 +422,10 @@ func updateUserEmailCmdF(command *cobra.Command, args []string) error { } defer a.Shutdown() + if len(args) != 2 { + return errors.New("Expected two arguments. See help text for details.") + } + newEmail := args[1] if !model.IsValidEmail(newEmail) { @@ -440,7 +444,7 @@ func updateUserEmailCmdF(command *cobra.Command, args []string) error { user.Email = newEmail _, errUpdate := a.UpdateUser(user, true) if errUpdate != nil { - return errUpdate + return errors.New(errUpdate.Message) } return nil |