Skip to content

Commit

Permalink
Remove inaccurate rating change check
Browse files Browse the repository at this point in the history
  • Loading branch information
Raajheer1 committed Oct 15, 2024
1 parent 8714ede commit f961c5b
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions internal/v1/user/visitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,19 +316,6 @@ func isEligibleVisiting(user *models.User) bool {
return false
}

ratechange, err := vatsim.GetDateOfRatingChange(fmt.Sprint(user.CID))
if err != nil {
log.Errorf("Error getting date of rating change: %s", err)
return false
}

// Check that ratechange is more than 90 days ago
// VATSIM API apparently returns nil if it was a long time ago... so we can assume this check is true
// VATUSA only knows about controllers whose rating is changed by VATUSA, so we enforce this by also checking VATSIM
if ratechange != nil && ratechange.After(time.Now().AddDate(0, 0, -90)) {
return false
}

// Check VATUSA eligibility
eligible, _, err := vatusa.IsVisitorEligible(fmt.Sprint(user.CID))
if err != nil {
Expand Down

1 comment on commit f961c5b

@Raajheer1
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Meant to PR but forgot to change branches, this check is done more accurately at the VATUSA level already. Instead of checking for all rating changes really we only care about S1, S2, S3, C1 which is checked during the vatusa.IsVisitorEligible() check

Please sign in to comment.