Skip to content

Instantly share code, notes, and snippets.

@qpfiffer
Created April 18, 2014 21:06
Show Gist options
  • Save qpfiffer/11064421 to your computer and use it in GitHub Desktop.
Save qpfiffer/11064421 to your computer and use it in GitHub Desktop.
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