Dashboard
PHP:
8.2.30
OS:
Linux
User:
dh_nv8b2m
/
/
usr
/
lib
/
python3
/
dist-packages
/
django
/
contrib
/
messages
/
storage
/
__pycache__
📤 Upload
📝 New File
📁 New Folder
Close
Editing: fallback.cpython-310.pyc
o ǎ�_/ � @ s8 d dl mZ d dlmZ d dlmZ G dd� de�ZdS )� )�BaseStorage)� CookieStorage)�SessionStoragec s8 e Zd ZdZeefZ� fdd�Zdd� Zdd� Z � Z S )�FallbackStoragezu Try to store all messages in the first backend. Store any unstored messages in each subsequent backend. c s6 t � j� i ��� � �fdd�| jD �| _t� | _d S )Nc s g | ] }|� i ����qS � r )�.0� storage_class��args�kwargsr �J/usr/lib/python3/dist-packages/django/contrib/messages/storage/fallback.py� <listcomp> s �z,FallbackStorage.__init__.<locals>.<listcomp>)�super�__init__�storage_classes�storages�set�_used_storages)�selfr r �� __class__r r r s �zFallbackStorage.__init__c O s^ g }| j D ]%}|�� \}}|du r ||fS |r| j�|� |�|� |r* ||fS q||fS )zJ Get a single list of messages from all storage backends. N)r �_getr �add�extend)r r r �all_messages�storage�messages� all_retrievedr r r r s � �zFallbackStorage._getc O sH | j D ]}|r|j||dd�}q|| jv r!|�g |� | j�|� q|S )z� Store the messages and return any unstored messages after trying all backends. For each storage backend, any messages not stored are passed on to the next backend. F)� remove_oldest)r �_storer �remove)r r �responser r r r r r r &