
    hw&                     x    S SK Jr  S SKJr  S SKJr  S SKJr  S SKJ	r	  S SK
Jr  SSKJr  S	 rSS jrSS jrS rg
)    )chain)
MethodType)apps)settings)checks)import_string   )_get_builtin_permissionsc                     [        U 5      n[        U5       H%  u  p4 [        U5      n[        XR5      (       a  Us  $ M'     g! [        [        4 a     M=  f = f)z
Return the index of dotted class path (or a subclass of that class) in a
list of candidate paths. If it does not exist, return -1.
)r   	enumerate
issubclassImportError	TypeError)
class_pathcandidate_pathsclsindexpathcandidate_clss         L/var/www/html/env/lib/python3.13/site-packages/django/contrib/auth/checks.py_subclass_indexr      sa    
 

#C 1	)$/M--- . 2  Y' 		s   AAANc           
        ^ U c%  [         R                  " [        R                  5      mOO[        R                  R	                  S5      u  p#U  H&  nUR
                  U:X  d  M  UR                  U5      m  O   / $ / n[        TR                  [        [        45      (       d%  UR                  [        R                  " STSS95        TR                  TR                  ;   aC  UR                  [        R                  " SSTR                  < STR                  < S3TS	S
95        TR                  R                  TR                  5      R                   (       d  [#        U4S jTR                  R$                   5       5      (       d  [        R&                  S/:X  aM  UR                  [        R                  " STR                  R(                  < STR                  < S3TSS95        OMUR                  [        R*                  " STR                  R(                  < STR                  < S3STSS
95        [        T" 5       R,                  [.        5      (       a(  UR                  [        R0                  " ST-  TSS95        [        T" 5       R2                  [.        5      (       a(  UR                  [        R0                  " ST-  TSS95        U$ )N.z*'REQUIRED_FIELDS' must be a list or tuple.z	auth.E001objidzjThe field named as the 'USERNAME_FIELD' for a custom user model must not be included in 'REQUIRED_FIELDS'.z*The 'USERNAME_FIELD' is currently set to 'z', you should remove 'z' from the 'REQUIRED_FIELDS'.z	auth.E002)hintr   r   c              3   X   >#    U  H  nUR                   TR                  4:H  v   M!     g 7fN)fieldsUSERNAME_FIELD).0
constraintr   s     r   	<genexpr>#check_user_model.<locals>.<genexpr>H   s-      F<J 	c0022<s   '*z)django.contrib.auth.backends.ModelBackend'z=' must be unique because it is named as the 'USERNAME_FIELD'.z	auth.E003z9' is named as the 'USERNAME_FIELD', but it is not unique.zKEnsure that your authentication backend(s) can handle non-unique usernames.z	auth.W004z%s.is_anonymous must be an attribute or property rather than a method. Ignoring this is a security issue as anonymous users will be treated as authenticated!z	auth.C009z%s.is_authenticated must be an attribute or property rather than a method. Ignoring this is a security issue as anonymous users will be treated as authenticated!z	auth.C010)r   	get_modelr   AUTH_USER_MODELsplitlabel
isinstanceREQUIRED_FIELDSlisttupleappendr   Errorr"   _meta	get_fielduniqueanytotal_unique_constraintsAUTHENTICATION_BACKENDSobject_nameWarningis_anonymousr   Criticalis_authenticated)app_configskwargs	app_label
model_name
app_configerrorsr   s         @r   check_user_modelrC      sh   nnX556 ( 8 8 > >s C	%J9, **:6 & IF c))D%=99LL<	
 S000LLU
 ))3+=+=? 
	
 99s11299# F))<<F C C ++70
 
 MM+.99+@+@#BTBTV"	 MMyy,,c.@.@B0 "	 #%$$j11OO:<?@ 	
 #%((*55OO:<?@ 	
 M    c                    U c  [         R                  " 5       nO[        R                  " S U  5       5      n[         R                  " SS5      nUR
                  R                  S5      R                  nUR
                  R                  S5      R                  n/ nU GHU  nUR
                  n[        [        U5      5      n	U	(       a   [        S U	R                  5        5       5      OSn
X:  aO  UU
[        UR                  5      -
  -
  nUR                  [        R                   " SUR"                  X4-  US	S
95        U	(       a   [        S U	R%                  5        5       5      OSnX:  aP  UU[        UR&                  5      -
  -
  nUR                  [        R                   " SUR"                  UU4-  USS
95        [)        5       nUR*                   GH  u  nn[        U5      U:  a5  UR                  [        R                   " SUUR"                  U4-  USS
95        [        U5      U:  a5  UR                  [        R                   " SUUR"                  U4-  USS
95        X;   a9  UR                  [        R                   " SU< SUR"                  < S3USS
95        O=X;   a8  UR                  [        R                   " SU< SUR"                  < S3USS
95        UR-                  U5        GM     GMX     U$ )Nc              3   @   #    U  H  oR                  5       v   M     g 7fr    )
get_models)r#   rA   s     r   r%   +check_models_permissions.<locals>.<genexpr>   s      %
6A
!!##ks   auth
Permissionnamecodenamec              3   8   #    U  H  n[        U5      v   M     g 7fr    len)r#   rK   s     r   r%   rH      s     C&BdD		&B   r   zzThe verbose_name of model '%s' must be at most %d characters for its builtin permission names to be at most %d characters.z	auth.E007r   c              3   8   #    U  H  n[        U5      v   M     g 7fr    rN   )r#   rL   s     r   r%   rH      s     I.H(H.HrP   zvThe name of model '%s' must be at most %d characters for its builtin permission codenames to be at most %d characters.z	auth.E011zEThe permission named '%s' of model '%s' is longer than %d characters.z	auth.E008zIThe permission codenamed '%s' of model '%s' is longer than %d characters.z	auth.E012zThe permission codenamed 'z/' clashes with a builtin permission for model 'z'.z	auth.E005z' is duplicated for model 'z	auth.E006)r   rG   r   from_iterabler(   r2   r3   
max_lengthdictr
   maxvaluesrO   verbose_name_rawr0   r   r1   r+   keysr@   setpermissionsadd)r=   r>   modelsrJ   permission_name_max_lengthpermission_codename_max_lengthrB   modeloptsbuiltin_permissions"max_builtin_permission_name_lengthverbose_name_max_length&max_builtin_permission_codename_lengthmodel_name_max_length	codenamesrL   rK   s                    r   check_models_permissionsrg   |   s   "$$ %
6A%
 
 5J!+!1!1!;!;F!C!N!N%/%5%5%?%?
%K%V%V"F{{"#;D#AB # C&9&@&@&BCC 	+
 .J&@2S9N9N5OO'# MM* zz#:WX "	 # I.A.F.F.HII 	/
 2R$B6T__9MM%! MM" 

-6 " E	"..NHd4y55LL. ! JJ6 "&
 8}==LL5 % JJ: "&
 .LL8@$**N!&	 &LL)14::?!&	 MM(#e /a H MrD   c                     / n[        S[        R                  5      nUS:w  aI  [        S[        R                  5      nUS:X  d  XC:  a$  UR                  [        R
                  " SSS95        U$ )Nz6django.contrib.auth.middleware.LoginRequiredMiddlewarer   z7django.contrib.auth.middleware.AuthenticationMiddlewarezIn order to use django.contrib.auth.middleware.LoginRequiredMiddleware, django.contrib.auth.middleware.AuthenticationMiddleware must be defined before it in MIDDLEWARE.z	auth.E013)r   )r   r   
MIDDLEWAREr0   r   r1   )r=   r>   rB   login_required_index
auth_indexs        r   check_middlewarerl      sw    F*@
 r!$E

 z@MMX #	 MrD   r    )	itertoolsr   typesr   django.appsr   django.confr   django.corer   django.utils.module_loadingr   
managementr
   r   rC   rg   rl    rD   r   <module>ru      s2          5 0 ]@qhrD   