
    hr                     6    S SK r S SKJr  S SKJr  S SKJr  S rg)    N)get_running_loopwraps)SynchronousOnlyOperationc                 L   ^  U 4S jn[        T 5      (       a  T nSm U" U5      $ U$ )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                 4   >^  [        T 5      U U4S j5       nU$ )Nc                     >  [        5         [        R                  R                  S5      (       d  [	        T5      e T" U 0 UD6$ ! [
         a     Nf = f)NDJANGO_ALLOW_ASYNC_UNSAFE)r   osenvirongetr   RuntimeError)argskwargsfuncmessages     F/var/www/html/env/lib/python3.13/site-packages/django/utils/asyncio.pyinner.async_unsafe.<locals>.decorator.<locals>.inner   s[    < " zz~~&ABB27;; C (((   s   
A 
AAr   )r   r   r   s   ` r   	decoratorasync_unsafe.<locals>.decorator   s     	t
	) 

	)     zKYou cannot call this from an async context - use a thread or sync_to_async.)callable)r   r   r   s   `  r   async_unsafer      s6    "  	 r   )r   asyncior   	functoolsr   django.core.exceptionsr   r    r   r   <module>r      s    	 $  ;r   