Created
April 18, 2014 21:06
-
-
Save qpfiffer/11064421 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
from django.contrib.messages.storage import default_storage | |
class MessagesSuck(object): | |
""" | |
Shoots django messages in the face. | |
""" | |
def process_request(self, request): | |
# Confuse django message, mezzanine and friends into | |
# assuming we still work: | |
class LetsPlayPretend(list): | |
def add(*args, **kwargs): | |
pass | |
def update(*args, **kwargs): | |
pass | |
request._messages = LetsPlayPretend() | |
def process_response(self, request, response): | |
return response |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment