
    	]j>                     T    d Z ddlZddlmZ  ej                  e      Z G d d      Zy)zThis file and its contents are licensed under the Apache License 2.0. Please see the included NOTICE for copyright information and LICENSE for a copy of the license.
    N)Organizationc                       e Zd Zd Zd Zy)DummyGetSessionMiddlewarec                     || _         y )N)get_response)selfr   s     O/root/env/lib/python3.12/site-packages/label_studio/organizations/middleware.py__init__z"DummyGetSessionMiddleware.__init__   s
    (    c                    t         j                  j                         }|j                  }|r2|j                  r&|j
                  ||_        |j                  dg       ||j                  |j                  d<   | j                  |      }|S )Nactive_organization)update_fieldsorganization_pk)
r   objectsfirstuseris_authenticatedr   saveidsessionr   )r   requestorgr   responses        r	   __call__z"DummyGetSessionMiddleware.__call__   s|    ""((*||D))d.F.F.N'*D$II%:$;I<?14GOO-.$$W-r   N)__name__
__module____qualname__r
   r    r   r	   r   r   
   s    )	r   r   )__doc__loggingorganizations.modelsr   	getLoggerr   loggerr   r   r   r	   <module>r$      s,     -			8	$ r   