Skip to content

Conversation

abhitrueprogrammer
Copy link

No description provided.

@@ -18,7 +18,7 @@ func CheckRound(next http.Handler) http.Handler {
roundVal, _ := strconv.Atoi(round)

if user.RoundQualified != int32(roundVal) {
httphelpers.WriteError(w, http.StatusForbidden, "not qualified")
httphelpers.WriteError(w, http.StatusForbidden, "round not enabled yet")
Copy link
Contributor

Choose a reason for hiding this comment

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

what if round 2 is enabled and user was not qualified for it so their round is 1

Copy link
Author

Choose a reason for hiding this comment

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

There's "User is not qualified for this round" error for that (in preview questions and other routes.) Unless this is being used in the frontend to tell whether the user is qualified for the round, it shouldn't be an issue.

I guess a better solution would be to put up a seperate middleware to tell whether the round is enabled or not, otherwise this error is misleading.

Copy link
Contributor

Choose a reason for hiding this comment

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

Round being enabled was a check from the frontend this time round

that's why we only check for qualification

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants