ó
ø¢TQc           @  sv   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	 e	 d ƒ Z
 d e f d „  ƒ  YZ d	 S(
   iÿÿÿÿ(   t   unicode_literals(   t   forms(   t   authenticate(   t   AuthenticationForm(   t   ugettext_lazyut   Please enter the correct %(username)s and password for a staff account. Note that both fields may be case-sensitive.t   AdminAuthenticationFormc        	   B  sE   e  Z d  Z e j d e j d d d i e d ƒ d 6ƒ Z d „  Z RS(   u>   
    A custom authentication form used in the admin app.

    t   widgett   initiali   t   error_messagesu6   Please log in again, because your session has expired.u   requiredc         C  sÑ   |  j  j d ƒ } |  j  j d ƒ } t } | rÀ | rÀ t d | d | ƒ |  _ |  j d  k r€ t j | i |  j j	 d 6ƒ ‚ qÀ |  j j
 sš |  j j rÀ t j | i |  j j	 d 6ƒ ‚ qÀ n  |  j ƒ  |  j  S(   Nu   usernameu   passwordt   usernamet   password(   t   cleaned_datat   gett   ERROR_MESSAGER   t
   user_cachet   NoneR   t   ValidationErrort   username_fieldt   verbose_namet	   is_activet   is_stafft   check_for_test_cookie(   t   selfR	   R
   t   message(    (    s3   ../Django//lib/python/django/contrib/admin/forms.pyt   clean   s    
(	   t   __name__t
   __module__t   __doc__R   t   BooleanFieldt   HiddenInputR   t   this_is_the_login_formR   (    (    (    s3   ../Django//lib/python/django/contrib/admin/forms.pyR      s   N(   t
   __future__R    t   djangoR   t   django.contrib.authR   t   django.contrib.auth.formsR   t   django.utils.translationR   R   R   (    (    (    s3   ../Django//lib/python/django/contrib/admin/forms.pyt   <module>   s   