
    Dvgw&                     v    d dl mZ d dlmZ d dlmZ d dlmZ d dlm	Z	 d dl
mZ ddlmZ d	 ZddZddZd Zd
S )    )chain)
MethodType)apps)settings)checks)import_string   )_get_builtin_permissionsc                     t          |           }t          |          D ]@\  }}	 t          |          }t          ||          r|c S *# t          t          f$ r Y =w xY wdS )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         W/var/www/pixelcanvas.ch/venv/lib/python3.11/site-packages/django/contrib/auth/checks.py_subclass_indexr      s    
 

#
#C 11  t	)$//M--- Y' 	 	 	H	2s    A		AANc           
         | t          j        t          j                  nKt          j                            d          \  }}| D ]$}|j        |k    r|                    |           n%g S g }t          j        t          t          f          s*|
                    t          j        dd                     j        j        v r<|
                    t          j        ddj        dj        dd	
                     j                            j                  j        st#          fdj        j        D                       st          j        dgk    rA|
                    t          j        dj        j        dj        dd                     nA|
                    t          j        dj        j        dj        ddd
                     t                       j        t.                    r-|
                    t          j        dz  d                     t                       j        t.                    r-|
                    t          j        dz  d                     |S )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   :   K   | ]}|j         j        fk    V  d S N)fieldsUSERNAME_FIELD).0
constraintr   s     r   	<genexpr>z#check_user_model.<locals>.<genexpr>H   sM       F F 	c022F F F F F F    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      s-   nX566 ( 8 > >s C C	:% 	 	J9,, **:66 - IF c)D%=99 
L<  	
 	
 	
 S000LU U
 )))3+=+=+=? 
 
 
	
 	
 	
 9s1229 # F F F F)<F F F C C  +70
 
 
 MM+.9+@+@+@#BTBTBTV"	      MMy,,,c.@.@.@B0 "	 	 	   ##%%$j11 	
O:<?@   	
 	
 	
 ##%%(*55 	
O:<?@   	
 	
 	
 Mr&   c                    | t          j                    }nt          j        d | D                       }t          j        dd          }|j                            d          j        }|j                            d          j        }g }|D ]e}|j        }t          t          |                    }	|	r+t          d |	                                D                       nd}
|
|k    rO||
t          |j                  z
  z
  }|                    t          j        d|j        ||fz  |d	
                     |	r+t          d |	                                D                       nd}||k    rO||t          |j                  z
  z
  }|                    t          j        d|j        ||fz  |d
                     t)                      }|j        D ] \  }}t          |          |k    r5|                    t          j        d||j        |fz  |d
                     t          |          |k    r5|                    t          j        d||j        |fz  |d
                     ||	v r7|                    t          j        d|d|j        d|d
                     n:||v r6|                    t          j        d|d|j        d|d
                     |                    |           "g|S )Nc              3   >   K   | ]}|                                 V  d S r    )
get_models)r#   rA   s     r   r%   z+check_models_permissions.<locals>.<genexpr>   s?       %
 %
(2J!!##%
 %
 %
 %
 %
 %
r&   auth
Permissionnamecodenamec              3   4   K   | ]}t          |          V  d S r    len)r#   rI   s     r   r%   z+check_models_permissions.<locals>.<genexpr>   s(      CCdD		CCCCCCr&   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   4   K   | ]}t          |          V  d S r    rL   )r#   rJ   s     r   r%   z+check_models_permissions.<locals>.<genexpr>   s(      II(HIIIIIIr&   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   rF   r   from_iterabler(   r2   r3   
max_lengthdictr
   maxvaluesrM   verbose_name_rawr0   r   r1   r+   keysr@   setpermissionsadd)r=   r>   modelsrH   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	codenamesrJ   rI   s                    r   check_models_permissionsrd   |   s   ""$ %
 %
6A%
 %
 %
 
 
 55J!+!1!;!;F!C!C!N%/%5%?%?
%K%K%V"F b$ b${"#;D#A#ABB #CCC&9&@&@&B&BCCCCCC 	+
 .0JJJ&@2S9N5O5OO'# MM* z#:<VWX "  	 	 	 #CII.A.F.F.H.HIIIIII 	/
 24RRR$B6T_9M9MM%! MM" 
-6 "     EE	". 2	$ 2	$NHd4yy555L. ! J6 "&
 
 
   8}}===L5 % J: "&
 
 
   ...LL8@$***N!&	      Y&&LL)14:::?!&	     MM(####e2	$h Mr&   c                     g }t          dt          j                  }|dk    rOt          dt          j                  }|dk    s||k    r)|                    t	          j        dd                     |S )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_middlewareri      s    F*@ 
 r!!$E
 

 z,@@@MMX #	     Mr&   r    )	itertoolsr   typesr   django.appsr   django.confr   django.corer   django.utils.module_loadingr   
managementr
   r   rC   rd   ri    r&   r   <module>rr      s                                        5 5 5 5 5 5 0 0 0 0 0 0   ] ] ] ]@q q q qh    r&   