Merge pull request #1127 from DonPiotr/develop

Fix two error messages: user create and user create --admin
This commit is contained in:
Matt Baer 2024-10-30 13:31:18 -04:00 committed by GitHub
commit e29f371232
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

4
app.go
View File

@ -892,12 +892,12 @@ func CreateUser(apper Apper, username, password string, isAdmin bool) error {
if isAdmin { if isAdmin {
// Abort if trying to create admin user, but one already exists // Abort if trying to create admin user, but one already exists
if firstUser != nil { if firstUser != nil {
return fmt.Errorf("Admin user already exists (%s). Create a regular user with: writefreely --create-user", firstUser.Username) return fmt.Errorf("Admin user already exists (%s). Create a regular user with: writefreely user create [USER]:[PASSWORD]", firstUser.Username)
} }
} else { } else {
// Abort if trying to create regular user, but no admin exists yet // Abort if trying to create regular user, but no admin exists yet
if firstUser == nil { if firstUser == nil {
return fmt.Errorf("No admin user exists yet. Create an admin first with: writefreely --create-admin") return fmt.Errorf("No admin user exists yet. Create an admin first with: writefreely user create --admin [USER]:[PASSWORD]")
} }
} }