ó
;ĎOc           @   s:   d  d l  m Z d  d l m Z d e f d     YZ d S(   i˙˙˙˙(   t   settings(   t   default_storaget   MessageMiddlewarec           B   s    e  Z d  Z d   Z d   Z RS(   s5   
    Middleware that handles temporary messages.
    c         C   s   t  |  | _ d  S(   N(   R   t	   _messages(   t   selft   request(    (    s;   ../Django//lib/python/django/contrib/messages/middleware.pyt   process_request
   s    c         C   sF   t  | d  rB | j j |  } | rB t j rB t d   qB n  | S(   sš   
        Updates the storage backend (i.e., saves the messages).

        If not all messages could not be stored and ``DEBUG`` is ``True``, a
        ``ValueError`` is raised.
        R   s+   Not all temporary messages could be stored.(   t   hasattrR   t   updateR    t   DEBUGt
   ValueError(   R   R   t   responset   unstored_messages(    (    s;   ../Django//lib/python/django/contrib/messages/middleware.pyt   process_response   s
    	(   t   __name__t
   __module__t   __doc__R   R   (    (    (    s;   ../Django//lib/python/django/contrib/messages/middleware.pyR      s   	N(   t   django.confR    t   django.contrib.messages.storageR   t   objectR   (    (    (    s;   ../Django//lib/python/django/contrib/messages/middleware.pyt   <module>   s   