Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #106: Display error message while submitting when user doesn't participate in a challenge #258

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Fix #106: Display error message while submitting when user doesn't participate in a challenge #258

wants to merge 4 commits into from

Conversation

hkmatsumoto
Copy link
Contributor

Fix #106

The corresponding GCI task

Changes:

  • Add lines to display an error message when a user submitting to the challenge s/he doesn't participate.

@vkartik97 @pushkalkatara
Could you take a look? Thanks in advance!

@hkmatsumoto
Copy link
Contributor Author

hkmatsumoto commented Jan 16, 2020

Brief explanation of the logic of this code lines:
When a user submits to the challenges s/he doesn't participate using cli, these lines in EvalAI will be called and

{"error": "You haven't participated in the challenge"}

is returned with 403 status code.

Thus, to detect the error I check if the returned status code equals to 403, and
if so print the ["error"] of the returned json which is "You haven't participated in the challenge", as you see in the json code above.

@hkmatsumoto
Copy link
Contributor Author

Screencast:
Screenshot from 2020-01-16 23-36-35

@hkmatsumoto hkmatsumoto changed the title Fix #106: Display error message Fix #106: Display error message while submitting when user doesn't participate in a challenge Jan 16, 2020
tests/test_requests.py Outdated Show resolved Hide resolved
@yashdusing
Copy link

LGTM 👍

@hkmatsumoto
Copy link
Contributor Author

@yashdusing Thanks! Can I also get my task approved?

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.

Show error message while submitting when user doesn't participate in a challenge.
3 participants