î

_ÝV2  ã               @   sP   d  d l  m Z d  d l m Z d  d l m Z d  d l m Z d d „  Z d S)é    )Úunicode_literals)Úapps)Úsettings)Úchecksc           	   K   sB  g  } t  j t j ƒ } t | j t t f ƒ s[ | j t	 j
 d d d  d | d d ƒƒ n  | j | j k r˜ | j t	 j
 d d d  d | d d ƒƒ n  | j j | j ƒ j s>t j d g k r | j t	 j
 d	 | j j | j f d d  d | d d
 ƒƒ q>| j t	 j d | j j | j f d d d | d d ƒƒ n  | S)Nz*'REQUIRED_FIELDS' must be a list or tuple.ZhintÚobjÚidz	auth.E001zjThe field named as the 'USERNAME_FIELD' for a custom user model must not be included in 'REQUIRED_FIELDS'.z	auth.E002z)django.contrib.auth.backends.ModelBackendzC'%s.%s' must be unique because it is named as the 'USERNAME_FIELD'.z	auth.E003z?'%s.%s' is named as the 'USERNAME_FIELD', but it is not unique.zKEnsure that your authentication backend(s) can handle non-unique usernames.z	auth.W004)r   Z	get_modelr   ZAUTH_USER_MODELÚ
isinstanceZREQUIRED_FIELDSÚlistÚtupleÚappendr   ÚErrorZUSERNAME_FIELDZ_metaÚ	get_fieldÚuniqueZAUTHENTICATION_BACKENDSZobject_nameÚWarning)ÚkwargsÚerrorsÚcls© r   ú</tmp/pip-build-ghmbqnp_/Django/django/contrib/auth/checks.pyÚcheck_user_model	   sD    r   N)	Ú
__future__r   Zdjango.appsr   Zdjango.confr   Zdjango.corer   r   r   r   r   r   Ú<module>   s   