Skip to content

Commit 1182943

Browse files
committed
add more comments
1 parent 397f2cd commit 1182943

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

cmd/admin_user_create.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ func runCreateUser(c *cli.Context) error {
9191
return fmt.Errorf("invalid user type: %s", c.String("user-type"))
9292
}
9393
if userType != user_model.UserTypeIndividual {
94+
// Some other commands like "change-password" also only support individual users.
95+
// It needs to clarify the "password" behavior for bot users in the future.
96+
// At the moment, we do not allow setting password for bot users.
9497
if c.IsSet("password") || c.IsSet("random-password") {
9598
return errors.New("password can only be set for individual users")
9699
}

models/user/user.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,7 @@ func (u *User) ValidatePassword(passwd string) bool {
385385
}
386386

387387
// IsPasswordSet checks if the password is set or left empty
388+
// TODO: It's better to clarify the "password" behavior for different types (individual, bot)
388389
func (u *User) IsPasswordSet() bool {
389390
return u.Passwd != ""
390391
}

0 commit comments

Comments
 (0)