a
    Šxd”  ã                   @   s,   d dl mZ ddlmZ G dd„ deƒZdS )é    )ÚMiddlewareMixiné   )ÚHistoricalRecordsc                   @   s    e Zd ZdZdd„ Zdd„ ZdS )ÚHistoryRequestMiddlewarezåExpose request to HistoricalRecords.

    This middleware sets request as a local context/thread variable, making it
    available to the model-level utilities to allow tracking of the authenticated user
    making a change.
    c                 C   s   |t j_d S )N)r   ÚcontextÚrequest)Úselfr   © r	   úQ/var/www/html/Ranjet/env/lib/python3.9/site-packages/simple_history/middleware.pyÚprocess_request   s    z(HistoryRequestMiddleware.process_requestc                 C   s   t tjdƒrtj`|S )Nr   )Úhasattrr   r   r   )r   r   Úresponser	   r	   r
   Úprocess_response   s    z)HistoryRequestMiddleware.process_responseN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r	   r	   r	   r
   r      s   r   N)Zdjango.utils.deprecationr   Úmodelsr   r   r	   r	   r	   r
   Ú<module>   s   