Commit ae282d2a authored by Kevin Di Lallo's avatar Kevin Di Lallo
Browse files

review follow-up

parent 8edd14b2
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -204,8 +204,8 @@ func (pc *Connector) DeleteTable(tableName string) (err error) {
// CreateUser - Create new user
func (pc *Connector) CreateUser(provider string, username string, password string, role string, sboxname string) (err error) {
	// Validate input
	if username == "" {
		return errors.New("Missing username")
	if provider == "" {
		provider = ProviderLocal
	}
	if username == "" {
		return errors.New("Missing username")
@@ -221,9 +221,6 @@ func (pc *Connector) CreateUser(provider string, username string, password strin
			return err
		}
	}
	if provider == "" {
		provider = ProviderLocal
	}

	// Create entry
	query := `INSERT INTO ` + UsersTable + ` (provider, username, password, role, sboxname)
@@ -487,5 +484,5 @@ func isValidRole(role string) error {
	case RoleUser, RoleAdmin:
		return nil
	}
	return errors.New("Inalid role")
	return errors.New("Invalid role")
}