Created
June 13, 2012 19:19
-
-
Save groovecoder/2925901 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jingo | |
from wiki import ReadOnlyException | |
class ReadOnlyMiddleware(object): | |
""" | |
Renders a 403.html page with a flag for a specific message. | |
""" | |
def process_exception(self, request, exception): | |
import pdb; pdb.set_trace() | |
if isinstance(exception, ReadOnlyException): | |
return jingo.render(request, 'handlers/403.html', | |
{'reason': exception.args[0]}, | |
status=403) | |
return None |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment