-
Notifications
You must be signed in to change notification settings - Fork 20
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
How Could the Response be None? #45
Comments
Looks bogus to me too. Whole stuff can be replaced with: context.REQUEST.RESPONSE.redirect(...) IIRC, that is how it used to be when I last noticed it. |
Oh good it's not just me. Unfortunately I can't reproduce this locally. This only seems to be None at times on production. For all I know this might not even be the fault of Ploneboard. Also, it does only seem to affect users with less than admin permissions, though I can't be sure that's a factor. |
Beside the topic: First I would convert the script into a view-class. I stopped fighting with Python-Script side effects. It's impossible to debug in a good manner (yeah, I know the tools). Checking Request for None is indeed strange. Even in async scenarios and tests the request should be mocked. So I think its save to remove the check. IMO its not the problem of the script, but of the caller, to provide an acquired request. But all this ambiguity will go if its proper code in a view class. |
We sometimes have the problem that adding a new comment won't redirect to the conversation. The reason seems to be this code:
Products.Ploneboard/src/Products/Ploneboard/skins/ploneboard_scripts/comment_redirect_to_conversation.py
Line 30 in d6accf8
I figure this is a long shot, but does anyone have any clue why the response could ever be None? Everything else seems to work fine. Even if the response is None, the comment is actually added.
Maybe there's a more robust way of accessing the response?
Anyway, if anyone has any clues I'll return the favor with a brew or pizza ;)
The text was updated successfully, but these errors were encountered: