AuthN: User Quota (#61540)

* remove reqContext from quota checks in login

* add guards for nil ScopeParams
This commit is contained in:
Jo
2023-01-16 11:54:15 +01:00
committed by GitHub
parent a4c2237d16
commit dcfeab2c73
8 changed files with 30 additions and 8 deletions
+1 -1
View File
@@ -198,7 +198,7 @@ func (ss *SqlStore) Count(ctx context.Context, scopeParams *quota.ScopeParameter
u.Set(tag, r.Count)
}
if scopeParams.OrgID != 0 {
if scopeParams != nil && scopeParams.OrgID != 0 {
if err := ss.db.WithDbSession(ctx, func(sess *sqlstore.DBSession) error {
rawSQL := "SELECT COUNT(*) AS count FROM data_source WHERE org_id=?"
if _, err := sess.SQL(rawSQL, scopeParams.OrgID).Get(&r); err != nil {