Refactor student views - #2526
Conversation
There was a problem hiding this comment.
What is the reasoning behind adding a TODO here instead of just making the jsonresponse actually return the status code as well?
There was a problem hiding this comment.
Because that's changing functionality. This pull request is intended to be purely for cleanup, without changing functionality whatsoever.
|
while you're at it I'd fix a few more: and there's a handful of pep8/pylint in tests.py that look straightforward to fix. The fixes and refactoring looks good overall but I am curious about the TODOs as mentioned above. |
|
👍 |
There was a problem hiding this comment.
This seems to disable fixme warnings for the entire file—is this actually what we want? I'd kind of prefer disabling it on a case-by-case basis (even though it's kind of annoying to add it next to each line), since I think we'd like to prevent people from adding TODOs to this file
There was a problem hiding this comment.
I believe that # pylint: disable= disables a warning for the entire file, regardless of where you put it. So repeating it multiple times, one on every line that I added, is more annoying and still ends up silencing all the TODOs anyway. Or am I wrong about that?
There was a problem hiding this comment.
Yeah - you put the pragma after a line to just disable it on that one line. See https://github.com/edx/edx-platform/blob/master/CONTRIBUTING.rst#pythonjavascript-styling
There was a problem hiding this comment.
There was a problem hiding this comment.
Although it's preferable to say disable=unused-argument over disable=W0511 as the latter obfuscates what warning you're actually disabling.
|
🚢 (once tests pass obvs) |
|
besides that one suggestion, ⛵ |
Fix pylint/pep8 warnings, use JsonResponse instead of HttpResponse where useful, put in TODOs to change HTTP status codes to be more accurate.
|
👍 let's merge this! |
…edx#2526) Co-authored-by: Sagirov Eugeniy <evhenyj.sahyrov@raccoongang.com>
Fix pylint/pep8 warnings, use JsonResponse instead of HttpResponse where useful, put in TODOs to change HTTP status codes to be more accurate, update tests to be less brittle.