Ask Your Question
2

AJAX responses sometimes don't work with 500 error due to exception

asked 2012-06-09 20:40:42 -0500

Andrew Wilcox gravatar image Andrew Wilcox
21 2

updated 2012-06-09 20:42:52 -0500

Evgeny gravatar image Evgeny flag of Chile
11329 50 84 183
http://askbot.org/

This isn't really a "question"… but I'm not sure where to file bugs as the Redmine instance wasn't allowing me to file anything.

Easy way to see this happen on 0.7.43: Add a comment, try to upvote it yourself. It happens in a few other places too, but this is easy to duplicate.

Instead of returning the error "You can't upvote your own comments" there is an HTTP 500 error. Looking at the backtrace, the problem is that the PermissionDenied exception does not have a "messages" variable. The hacky way to fix this (and what I'm using right now) is to change utils/decorators.py:90 to

            if isinstance(e, Exception) and hasattr(e, 'messages'):

I'm sure there's a better way, but this at least has fixed the issues so we don't have errors in production.

Thank you.

delete close flag offensive retag edit

1 Answer

Sort by » oldest newest most voted
1

answered 2012-06-14 19:49:45 -0500

Evgeny gravatar image Evgeny flag of Chile
11329 50 84 183
http://askbot.org/

I think this is fixed in the repository. Take a look here.

Will be available in 0.7.44.

link publish delete flag offensive edit

Your answer

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Reliable Askbot Hosting

Create your Q&A site at askbot.com. Managed Askbot hosting at just $15/mo. Dedicated hosting, support contracts, consulting services.

create your Q&A site
30 days free trial

Question tools

Follow

subscribe to rss feed

Stats

Asked: 2012-06-09 20:40:42 -0500

Seen: 50 times

Last updated: Jun 14 '12