
    qh*                     \    S SK Jr  SSKJr  SSKJrJr  SSKJr  \" 5       q	SS jr
S rS	 rg
)    )OrderedDict   )MissingBackend)module_memberuser_is_authenticated   )BaseAuthc                     U(       a
  [        5       q[        (       d>  U  H8  n[        U5      n[        U[        5      (       d  M%  U[        UR
                  '   M:     [        $ )a  
Load backends defined on SOCIAL_AUTH_AUTHENTICATION_BACKENDS, backends will
be imported and cached on BACKENDSCACHE. The key in that dict will be the
backend name, and the value is the backend class.

Only subclasses of BaseAuth (and sub-classes) are considered backends.

Previously there was a BACKENDS attribute expected on backends modules,
this is not needed anymore since it's enough with the
AUTHENTICATION_BACKENDS setting. BACKENDS was used because backends used to
be split on two classes the authentication backend and another class that
dealt with the auth mechanism with the provider, those classes are joined
now.

A force_load boolean argument is also provided so that get_backend
below can retry a requested backend that may not yet be discovered.
)r   BACKENDSCACHEr   
issubclassr	   name)backends
force_loadauth_backendbackends       L/var/www/html/env/lib/python3.13/site-packages/social_core/backends/utils.pyload_backendsr      sJ    & #=$L#L1G'8,,.5gll+ %     c                      [         U   $ ! [         a0    [        U SS9   [         U   s $ ! [         a    [        U5      ef = ff = f)a?  Returns a backend by name. Backends are stored in the BACKENDSCACHE
cache dict. If not found, each of the modules referenced in
AUTHENTICATION_BACKENDS is imported and checked for a BACKENDS
definition. If the named backend is found in the module's BACKENDS
definition, it's then stored in the cache for future access.
T)r   )r   KeyErrorr   r   )r   r   s     r   get_backendr   (   sU    	'T"" 'h40	' && 	' &&	''s    A+AAAc                 &   [        [        U5      R                  5       5      n/ X3S.n[        U 5      (       aT  UR                  R                  U 5      n[        [        U5      U Vs1 s H  ofR                  iM     sn-
  5      nXTS'   XtS'   U$ s  snf )a  
Will return backends data for given user, the return value will have the
following keys:
    associated: UserSocialAuth model instances for currently associated
                accounts
    not_associated: Not associated (yet) backend names
    backends: All backend names.

If user is not authenticated, then 'associated' list is empty, and there's
no difference between 'not_associated' and 'backends'.
)
associatednot_associatedr   r   r   )listr   keysr   userget_social_auth_for_usersetprovider)r   r   storage	availablevaluesr   assocr   s           r   user_backends_datar%   ;   s     ]8,1134I)SFT""\\::4@
c)nJ/WJ5J/WWX)|#1 M 0Xs   &B
N)F)collectionsr   
exceptionsr   utilsr   r   baser	   r   r   r   r%    r   r   <module>r+      s)    # ' 8  :'&r   