diff --git a/internal/service/handlers/claim_event.go b/internal/service/handlers/claim_event.go index 8b8f4c7..bf7c4f3 100644 --- a/internal/service/handlers/claim_event.go +++ b/internal/service/handlers/claim_event.go @@ -39,14 +39,9 @@ func ClaimEvent(w http.ResponseWriter, r *http.Request) { return } - evType := EventTypes(r).Get(event.Type) // expired events can be claimed + evType := EventTypes(r).Get(event.Type, evtypes.FilterInactive) if evType == nil { - Log(r).Errorf("Wrong event type %s is stored in DB: might be bad event config", event.Type) - ape.RenderErr(w, problems.InternalError()) - return - } - if evType.Disabled { - Log(r).Infof("Event type %s is disabled", event.Type) + Log(r).Infof("Event type %s is inactive", event.Type) ape.RenderErr(w, problems.Forbidden()) return } diff --git a/internal/service/workers/nooneisforgotten/main.go b/internal/service/workers/nooneisforgotten/main.go index 741d5ae..67e744d 100644 --- a/internal/service/workers/nooneisforgotten/main.go +++ b/internal/service/workers/nooneisforgotten/main.go @@ -264,7 +264,7 @@ func claimReferralSpecificEvents(db *pgdb.DB, types evtypes.Types, levels config countriesBalancesMap := make(map[string][]data.Balance, len(balances)) for _, balance := range balances { - if !balance.ReferredBy.Valid { + if !balance.ReferredBy.Valid || balance.Country == nil { continue } // country can't be nil because of db query logic