← Back
Editing: checks.cpython-311.pyc
� �|�eN � �^ � d dl mZ d dlmZ d dlmZ d dlmZ d dlm Z ddl mZ dd �Zdd �Z dS )� )�chain)� MethodType)�apps)�settings)�checks� )�_get_builtin_permissionsNc � �� | �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 dd�j �d�j �d��d � � � � � �j � �j � � j s�t# �fd��j j D � � � � s�t j dgk 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 fk V � �d S �N)�fields�USERNAME_FIELD)�.0� constraint�clss ��</usr/lib/python3/dist-packages/django/contrib/auth/checks.py� <genexpr>z#check_user_model.<locals>.<genexpr>7 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_modelr6 s( �� ����n�X�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� � �,�<�=� >� >��M�M����� �-�-�-�s�/A�/A�/A�� �"�� � � � � � � �M�M����� �-�-�-�s�/A�/A�/A�� g��"� � � � � � � �#�#�%�%�$�j�1�1� �� � ��O�:�<?�@� �� � � � � � � �#�#�%�%�(�*�5�5� �� � ��O�:�<?�@� �� � � � � � � �Mr c �� � | �t j � � }nt j d� | D � � � � }t j dd� � }|j � d� � j }|j � d� � j }g }|D �]e}|j }t t |� � � � } | r+t d� | � � � D � � � � nd} | |k rO|| t |j � � z z }|� t j d|j ||fz |d � � � � � | r+t d� | � � � D � � � � nd}||k rO||t |j � � z z } |� t j d|j | |fz |d � � � � � t) � � }|j D �] \ }}t |� � |k r5|� t j d||j |fz |d� � � � � t |� � |k r5|� t j d||j |fz |d� � � � � || v r7|� t j d|�d|j �d�|d� � � � � n:||v r6|� t j d|�d|j �d�|d� � � � � |� |� � ��"��g|S )Nc 3 �>