
    afr                     8    d dl Z d dlmZ d dlmZ d dlmZ d ZdS )    N)get_running_loopwraps)SynchronousOnlyOperationc                 N      fd}t                     r }d  ||          S |S )z
    Decorator to mark functions as async-unsafe. Someone trying to access
    the function while in an async context will get an error message.
    c                 @     t                      fd            }|S )Nc                      	 t                       t          j                            d          st	                    n# t
          $ r Y nw xY w | i |S )NDJANGO_ALLOW_ASYNC_UNSAFE)r   osenvirongetr   RuntimeError)argskwargsfuncmessages     F/var/www/html/env/lib/python3.11/site-packages/django/utils/asyncio.pyinnerz.async_unsafe.<locals>.decorator.<locals>.inner   sy    < """ z~~&ABB <27;;;<      4((((s   A   
AAr   )r   r   r   s   ` r   	decoratorzasync_unsafe.<locals>.decorator   s9    	t
	) 
	) 
	) 
	) 
	) 

	)     zKYou cannot call this from an async context - use a thread or sync_to_async.)callable)r   r   r   s   `  r   async_unsafer      sS        "   	 yr   )r   asyncior   	functoolsr   django.core.exceptionsr   r    r   r   <module>r      s]    				 $ $ $ $ $ $       ; ; ; ; ; ;    r   