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
It won't raise expected error when nestedly use course_view decorator #395
Comments
Can we just add an attribute |
I don't understand what the problem is. Could you explain? |
In short, I can't find a situation that could trigger the exception. |
If you do
that should raise, no? |
I tested with: @coures_view
def func_a(pctx):
...
return fuc_b(pctx)
@course_view
def func_b(pctx):
... It doesn't raise the expected |
But each decorator creates a new |
It's also the case for context manager, unless we are |
It can be, but it doesn't have to be. This form will make new instances (and hence won't conflict):
but this will:
It's perhaps an unlikely scenario to defend against, but I just don't like code that has the potential to be silently incorrect. (and it's easy to get into that situation if you're modifying state) |
Got it. Thanks for the explanation. |
Todo: add tests for this part. |
Tested by #535 , closing. |
relate/course/utils.py
Line 683 in 63a25b6
If I decorate
relate/course/utils.py
Line 845 in 63a25b6
course_view
, it just failed with 404, not the expected error.The
_is_in_context_manager
are unknow to each other in differentCoursePageContext
instances..The text was updated successfully, but these errors were encountered: