This reverts commit 326ea86a57.
This commit is contained in:
@@ -14,15 +14,15 @@ func Quota(quotaService quota.Service) func(string) web.Handler {
|
||||
panic("quotaService is nil")
|
||||
}
|
||||
//https://open.spotify.com/track/7bZSoBEAEEUsGEuLOf94Jm?si=T1Tdju5qRSmmR0zph_6RBw fuuuuunky
|
||||
return func(targetSrv string) web.Handler {
|
||||
return func(target string) web.Handler {
|
||||
return func(c *models.ReqContext) {
|
||||
limitReached, err := quotaService.QuotaReached(c, quota.TargetSrv(targetSrv))
|
||||
limitReached, err := quotaService.QuotaReached(c, target)
|
||||
if err != nil {
|
||||
c.JsonApiErr(500, "Failed to get quota", err)
|
||||
return
|
||||
}
|
||||
if limitReached {
|
||||
c.JsonApiErr(403, fmt.Sprintf("%s Quota reached", targetSrv), nil)
|
||||
c.JsonApiErr(403, fmt.Sprintf("%s Quota reached", target), nil)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user