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

http_method POST will always fail #24

Open
thraxil opened this issue Apr 4, 2022 · 2 comments
Open

http_method POST will always fail #24

thraxil opened this issue Apr 4, 2022 · 2 comments

Comments

@thraxil
Copy link
Contributor

thraxil commented Apr 4, 2022

At the end of the grade_user() method, there's a check on whether grade >= 0: https://github.com/appsembler/xblock-grade-fetcher/blob/master/gradefetcher/gradefetcher.py#L492

That grade variable is only created on either line 416 or 418: https://github.com/appsembler/xblock-grade-fetcher/blob/master/gradefetcher/gradefetcher.py#L416 https://github.com/appsembler/xblock-grade-fetcher/blob/master/gradefetcher/gradefetcher.py#L418, both of which are inside the if self.http_method == "get": branch: https://github.com/appsembler/xblock-grade-fetcher/blob/master/gradefetcher/gradefetcher.py#L367

If http_method is instead post, and it skips that branch, running https://github.com/appsembler/xblock-grade-fetcher/blob/master/gradefetcher/gradefetcher.py#L473, grade never gets defined and the whole thing will always fail with a NameError exception.

@thraxil
Copy link
Contributor Author

thraxil commented Apr 4, 2022

@amirtds
Copy link
Contributor

amirtds commented Apr 19, 2022

@thraxil We didn't implement the POST method functionality and users can't set the HTTP method to post in the studio author UI. I remove that code block for POST to prevent confusion.

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

No branches or pull requests

2 participants