o
    ëË·e«  ã                   @   s$   d dl mZ d dlmZ dd„ ZdS )é    ©Úwraps)Ú	ratelimitc                    sT   ddl m} |j ˆ ¡}|r!t |¡}ˆ d|j¡ ˆ d|j¡ ‡ ‡fdd„}|S )Nr   )Úapp_settingsÚdurationÚamountc                    s   t ˆ ƒ‡‡ ‡fdd„ƒ}|S )Nc                    s4   t j| fdˆ iˆ¤Ž}|sˆ| g|¢R i |¤Ž}|S )NÚaction)r   Úconsume_or_429)ÚrequestÚargsÚkwargsÚresp)r   ÚfunctionÚ	rl_kwargs© úI/var/www/ideatree/venv/lib/python3.10/site-packages/allauth/decorators.pyÚwrap   s   z+rate_limit.<locals>.decorator.<locals>.wrapr   )r   r   ©r   r   )r   r   Ú	decorator   s   zrate_limit.<locals>.decorator)	Úallauth.accountr   ÚRATE_LIMITSÚgetr   ÚparseÚ
setdefaultr   r   )r   r   r   Úrater   r   r   r   Ú
rate_limit   s   

r   N)Ú	functoolsr   Úallauthr   r   r   r   r   r   Ú<module>   s    