mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Users: remove unused store function (#88784)
This commit is contained in:
@@ -24,7 +24,6 @@ type store interface {
|
|||||||
GetByEmail(context.Context, *user.GetUserByEmailQuery) (*user.User, error)
|
GetByEmail(context.Context, *user.GetUserByEmailQuery) (*user.User, error)
|
||||||
Delete(context.Context, int64) error
|
Delete(context.Context, int64) error
|
||||||
LoginConflict(ctx context.Context, login, email string) error
|
LoginConflict(ctx context.Context, login, email string) error
|
||||||
CaseInsensitiveLoginConflict(context.Context, string, string) error
|
|
||||||
Update(context.Context, *user.UpdateUserCommand) error
|
Update(context.Context, *user.UpdateUserCommand) error
|
||||||
UpdateLastSeenAt(context.Context, *user.UpdateUserLastSeenAtCommand) error
|
UpdateLastSeenAt(context.Context, *user.UpdateUserLastSeenAtCommand) error
|
||||||
GetSignedInUser(context.Context, *user.GetSignedInUserQuery) (*user.SignedInUser, error)
|
GetSignedInUser(context.Context, *user.GetSignedInUserQuery) (*user.SignedInUser, error)
|
||||||
@@ -114,22 +113,6 @@ func (ss *sqlStore) notServiceAccountFilter() string {
|
|||||||
ss.dialect.BooleanStr(false))
|
ss.dialect.BooleanStr(false))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ss *sqlStore) CaseInsensitiveLoginConflict(ctx context.Context, login, email string) error {
|
|
||||||
users := make([]user.User, 0)
|
|
||||||
err := ss.db.WithDbSession(ctx, func(sess *db.Session) error {
|
|
||||||
if err := sess.Where("LOWER(email)=LOWER(?) OR LOWER(login)=LOWER(?)",
|
|
||||||
email, login).Find(&users); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(users) > 1 {
|
|
||||||
return &user.ErrCaseInsensitiveLoginConflict{Users: users}
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
})
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
func (ss *sqlStore) GetByLogin(ctx context.Context, query *user.GetUserByLoginQuery) (*user.User, error) {
|
func (ss *sqlStore) GetByLogin(ctx context.Context, query *user.GetUserByLoginQuery) (*user.User, error) {
|
||||||
// enforcement of lowercase due to forcement of caseinsensitive login
|
// enforcement of lowercase due to forcement of caseinsensitive login
|
||||||
query.LoginOrEmail = strings.ToLower(query.LoginOrEmail)
|
query.LoginOrEmail = strings.ToLower(query.LoginOrEmail)
|
||||||
|
|||||||
@@ -290,10 +290,6 @@ func (f *FakeUserStore) GetByID(context.Context, int64) (*user.User, error) {
|
|||||||
return f.ExpectedUser, f.ExpectedError
|
return f.ExpectedUser, f.ExpectedError
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *FakeUserStore) CaseInsensitiveLoginConflict(context.Context, string, string) error {
|
|
||||||
return f.ExpectedError
|
|
||||||
}
|
|
||||||
|
|
||||||
func (f *FakeUserStore) LoginConflict(context.Context, string, string) error {
|
func (f *FakeUserStore) LoginConflict(context.Context, string, string) error {
|
||||||
return f.ExpectedError
|
return f.ExpectedError
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user