o
    "4gt                     @   s  d dl Z d dlZd dlZd dlZd dlmZ d dlmZ d dlm	Z	 d dl
mZmZmZmZmZ d dlmZ d dlmZmZ d dlmZ d d	lmZ d d
lmZmZ d dlmZ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 dl-m.Z. d dl/m0Z1 d dl2m3Z4 d dl5m3Z3m6Z6 d dl7m8Z8m9Z9 d dl:m;Z; d dl<m=Z= d dl>m?Z?m@Z@ G dd de;ZAdddZBdS )    N)urlparse)settings)messages)authenticateget_backendsget_user_modelloginlogout)AbstractUser)MinimumLengthValidatorvalidate_password)get_current_site)FieldDoesNotExist)EmailMessageEmailMultiAlternatives)HttpResponseHttpResponseRedirect)resolve_url)TemplateDoesNotExist)render_to_stringreverse)timezone)get_random_string	force_str)gettext_lazyapp_settings)r   signals)context	ratelimit)BaseAdapterheaded_redirect_response)generate_unique_usernameimport_attributec                   @   s  e Zd ZdZi deddeddedded	d
eddeddeddeddeddeddeddeddeddeddedd ed!d"ejd#jd$ Zd%d& Z	d'd( Z
d)d* Zd+efd,d-Zd+efd.d/Zd0d1 Zdd3d4Zd5d6 Zd7d8 Zd9d: Zd;d< Zd=d> Zd?d@ ZdAdB ZdCdD ZdEdF ZddGdHZddJdKZddMdNZdOdP ZddQdRZdSdT Z 	2	2	U	2ddVdWZ!ddXdYZ"dZd[ Z#d\d] Z$d^d_ Z%d`da Z&dbdc Z'ddde Z(ddfdgZ)dhdi Z*djdk Z+dldm Z,dndo Z-dpdq Z.d+efdrdsZ/dtdu Z0dvdw Z1dxdy Z2dzd{ Z3d|d} Z4d~d Z5dd Z6dd Z7dd Z8dd Z9dd Z:dd Z;dd Z<dd Z=dd Z>dd Z?dddZ@d+efddZAd+efddZBdd ZCd+efddZDd2S )DefaultAccountAdapteraD  The adapter class allows you to override various functionality of the
    ``allauth.account`` app.  To do so, point ``settings.ACCOUNT_ADAPTER`` to
    your own class that derives from ``DefaultAccountAdapter`` and override the
    behavior by altering the implementation of the methods according to your own
    needs.
    account_inactivez#This account is currently inactive.cannot_remove_primary_emailz-You cannot remove your primary email address.duplicate_emailz;This email address is already associated with this account.email_password_mismatchz@The email address and/or password you specified are not correct.email_takenz5A user is already registered with this email address.enter_current_passwordz"Please type your current password.incorrect_codezIncorrect code.incorrect_passwordzIncorrect password.invalid_or_expired_keyzInvalid or expired key.invalid_password_resetz%The password reset token was invalid.max_email_addressesz,You cannot add more than %d email addresses.too_many_login_attemptsz0Too many failed login attempts. Try again later.unknown_emailz5The email address is not assigned to any user accountunverified_primary_emailz,Your primary email address must be verified.username_blacklistedz4Username can not be used. Please use other username.username_password_mismatchz;The username and/or password you specified are not correct.username_takenusernameuniquec                 C   s   ||j d< d S Naccount_verified_email)session)selfrequestemail rA   `/var/www/html/authentication-server/venv/lib/python3.10/site-packages/allauth/account/adapter.pystash_verified_emailT      z*DefaultAccountAdapter.stash_verified_emailc                 C   s   |j d}d |j d< |S r;   )r=   get)r>   r?   retrA   rA   rB   unstash_verified_emailW   s   
z,DefaultAccountAdapter.unstash_verified_emailc                 C   s(   d}|j d}|r| | k}|S )z
        Checks whether or not the email address is already verified
        beyond allauth scope, for example, by having accepted an
        invitation before signing up.
        Fr<   )r=   rE   lower)r>   r?   r@   rF   verified_emailrA   rA   rB   is_email_verified\   s
   z'DefaultAccountAdapter.is_email_verifiedreturnc                 C   sf   ddl m} |jj|jdj|jd }tj	tj
jk}|jr)|r#dS |r'dS dS |r-dS |r1dS dS )zP
        Returns whether or not the given email address can be deleted.
        r   EmailAddress)user_id)pkFT)allauth.account.modelsrM   objectsfilterrN   excluderO   existsr   AUTHENTICATION_METHODAuthenticationMethodEMAILprimary)r>   email_addressrM   	has_otherlogin_by_emailrA   rA   rB   can_delete_emailh   s*   z&DefaultAccountAdapter.can_delete_emailc                 C   s2   t j}|du rttj}dj|jd}|t| S )z2
        Formats the given email subject.
        Nz	[{name}] )name)r   EMAIL_SUBJECT_PREFIXr   r    r?   formatr]   r   )r>   subjectprefixsiterA   rA   rB   format_email_subject   s
   
z*DefaultAccountAdapter.format_email_subjectc                 C   s   t jS )z
        This is a hook that can be overridden to programmatically
        set the 'from' email address for sending emails
        )r   DEFAULT_FROM_EMAILr>   rA   rA   rB   get_from_email   s   z$DefaultAccountAdapter.get_from_emailNc              	   C   s  t |tr|gn|}td||}d|  }| |}|  }i }t	j
}	|	dfD ](}
zd||
}t||t d j ||
< W q- tyU   |
dkrS|sS Y q-w d|v rst||d |||d}|	|v rq|||	 d |S t|||	 |||d}d|_|S )	z
        Renders an email to `email`.  `template_prefix` identifies the
        email that is to be sent, e.g. "account/email/email_confirmation"
        z{0}_subject.txt txtz{0}_message.{1}r    )headersz	text/htmlhtml)
isinstancestrr   r_   join
splitlinesstriprc   rf   r   TEMPLATE_EXTENSIONglobalsr?   r   r   attach_alternativer   content_subtype)r>   template_prefixr@   r    ri   tor`   
from_emailbodieshtml_extexttemplate_namemsgrA   rA   rB   render_mail   sD   


z!DefaultAccountAdapter.render_mailc                 C   s:   |t t d jd}|| | |||}|  d S )Nr    )r@   current_site)r   rq   r?   updater|   send)r>   rt   r@   r    ctxr{   rA   rA   rB   	send_mail   s   
zDefaultAccountAdapter.send_mailc                 C   
   t tjS N)r   r   SIGNUP_REDIRECT_URLr>   r?   rA   rA   rB   get_signup_redirect_url      
z-DefaultAccountAdapter.get_signup_redirect_urlc                 C   s>   |j jsJ ttdd}|rtdt t|S tj}t|S )z
        Returns the default URL to redirect to after logging in.  Note
        that URLs passed explicitly (e.g. by passing along a `next`
        GET parameter) take precedence over the value returned here.
        LOGIN_REDIRECT_URLNAMENzSLOGIN_REDIRECT_URLNAME is deprecated, simply use LOGIN_REDIRECT_URL with a URL name)	useris_authenticatedgetattrr   warningswarnDeprecationWarningLOGIN_REDIRECT_URLr   )r>   r?   urlrA   rA   rB   get_login_redirect_url   s   z,DefaultAccountAdapter.get_login_redirect_urlc                 C   r   )a  
        Returns the URL to redirect to after the user logs out. Note that
        this method is also invoked if you attempt to log out while no users
        is logged in. Therefore, request.user is not guaranteed to be an
        authenticated user.
        )r   r   LOGOUT_REDIRECT_URLr   rA   rA   rB   get_logout_redirect_url   s   
z-DefaultAccountAdapter.get_logout_redirect_urlc                 C   sB   t | dd}|r|| jS | jjjrtjrtjS | | jS tjS )z@
        The URL to return to after email verification.
        #get_email_confirmation_redirect_urlN)r   r?   r   r   r   -EMAIL_CONFIRMATION_AUTHENTICATED_REDIRECT_URLr   )EMAIL_CONFIRMATION_ANONYMOUS_REDIRECT_URL)r>   rY   get_urlrA   rA   rB   #get_email_verification_redirect_url   s   

z9DefaultAccountAdapter.get_email_verification_redirect_urlc                 C      t dS )z
        The URL to redirect to after a successful password change/set.

        NOTE: Not called during the password reset flow.
        account_change_passwordr   r   rA   rA   rB    get_password_change_redirect_url   s   z6DefaultAccountAdapter.get_password_change_redirect_urlc                 C      dS )z
        Checks whether or not the site is open for signups.

        Next to simply returning True/False you can also intervene the
        regular flow by raising an ImmediateHttpResponse
        TrA   r   rA   rA   rB   is_open_for_signup  s   z(DefaultAccountAdapter.is_open_for_signupc                 C   s   t   }|S )z3
        Instantiates a new User instance.
        )r   r>   r?   r   rA   rA   rB   new_user  s   zDefaultAccountAdapter.new_userc           
   	   C   sd   ddl m}m}m} ||d}||d}||}||}	tjr0|||	p,| ||||	dg dS dS )z
        Fills in a valid username, if required and missing.  If the
        username is already present it is assumed to be valid
        (unique).
           
user_email
user_fielduser_username
first_name	last_namer   N)utilsr   r   r   r   USER_MODEL_USERNAME_FIELDr%   )
r>   r?   r   r   r   r   r   r   r@   r9   rA   rA   rB   populate_username  s   

z'DefaultAccountAdapter.populate_usernamec                 C   s
   t ||S r   )r%   )r>   txtsregexrA   rA   rB   r%   '  r   z.DefaultAccountAdapter.generate_unique_usernameTc                 C   s   ddl m}m}m} |j}|d}	|d}
|d}|d}||| ||| |	r3||d|	 |
r;||d|
 d|v rG||d  nd|v rS||d  n|  | || |rc|	  |S )	zd
        Saves a new `User` instance using information provided in the
        signup form.
        r   r   r   r   r@   r9   	password1password)
r   r   r   r   cleaned_datarE   set_passwordset_unusable_passwordr   save)r>   r?   r   formcommitr   r   r   datar   r   r@   r9   rA   rA   rB   	save_user*  s*   





zDefaultAccountAdapter.save_userFc                 C   sd   t jD ]}|| qdd t jD }| |v r| d|s0ddlm} || r0| d|S )z
        Validates the username. You can hook into this if you want to
        (dynamically) restrict what usernames can be chosen.
        c                 S   s   g | ]}|  qS rA   )rH   ).0ubrA   rA   rB   
<listcomp>R  s    z8DefaultAccountAdapter.clean_username.<locals>.<listcomp>r6   r   )filter_users_by_usernamer8   )r   USERNAME_VALIDATORSUSERNAME_BLACKLISTrH   validation_errorr   r   rT   )r>   r9   shallow	validatorusername_blacklist_lowerr   rA   rA   rB   clean_usernameI  s   



z$DefaultAccountAdapter.clean_usernamec                 C      |S )z
        Validates an email value. You can hook into this if you want to
        (dynamically) restrict what email addresses can be chosen.
        rA   r>   r@   rA   rA   rB   clean_email`  s   z!DefaultAccountAdapter.clean_emailc                 C   s&   t j}|rt|| t|| |S )z{
        Validates a password. You can hook into this if you want to
        restric the allowed password choices.
        )r   PASSWORD_MIN_LENGTHr   validater   )r>   r   r   
min_lengthrA   rA   rB   clean_passwordg  s
   
z$DefaultAccountAdapter.clean_passwordc                 C   r   r   rA   r   rA   rA   rB   validate_unique_emailr     z+DefaultAccountAdapter.validate_unique_email c                 C   s   t t |ddddrdS dtjv rN|rtj||||d dS z%|du r%i }t||tj }|rAt	
|}tj||||d W dS W dS  tyM   Y dS w dS )zx
        Wrapper of `django.contrib.messages.add_message`, that reads
        the message text from a template.
        allauthNheadlesszdjango.contrib.messages)
extra_tags)r   r   INSTALLED_APPSr   add_messager   r    r?   ro   rj   unescaper   )r>   r?   levelmessage_templatemessage_contextr   messageescaped_messagerA   rA   rB   r   u  s0   

z!DefaultAccountAdapter.add_messagec                 C   s   i }|j }|rd}||d< |r8|jdkr| rd}nd}nd}| ||d< t|dr0|  |jd|d< |d ur@||d	< tt	
||d
dS )N   locationPOSTi  r   renderutf8rj   r   application/json)statuscontent_type)status_codemethodis_validajax_response_formhasattrr   contentdecoder   jsondumps)r>   r?   responseredirect_tor   r   respr   rA   rA   rB   ajax_response  s(   

z#DefaultAccountAdapter.ajax_responsec              	   C   s   i g |  d}|D ]3}t|j| t|jdd |jD ddd |jjj	 D id}||d |j
< |d	 |j
 q
|S )
N)fieldsfield_ordererrorsc                 S   s   g | ]}t |qS rA   r   )r   erA   rA   rB   r     s    z<DefaultAccountAdapter.ajax_response_form.<locals>.<listcomp>attrsc                 S   s   i | ]	\}}|t |qS rA   r   )r   kvrA   rA   rB   
<dictcomp>  s    z<DefaultAccountAdapter.ajax_response_form.<locals>.<dictcomp>)labelvalue	help_textr   widgetr   r   )non_field_errorsr   r   r   r   r   fieldr   r   items	html_nameappend)r>   r   	form_specr   
field_specrA   rA   rB   r     s"   z(DefaultAccountAdapter.ajax_response_formc                C   s   |j s	| ||S d S r   )	is_activerespond_user_inactive)r>   r?   r   email_verificationsignal_kwargsr@   signupredirect_urlrA   rA   rB   	pre_login  s   zDefaultAccountAdapter.pre_loginc          
      C   sb   ddl m} t||||d}	|d u ri }tjjd|j||	|d| | |tj	dd|i |	S )Nr   )r   )r  )senderr?   r   r   zaccount/messages/logged_in.txtr   rA   )
r   r   r   r   user_logged_inr   	__class__r   r   SUCCESS)
r>   r?   r   r   r  r@   r  r  r   r   rA   rA   rB   
post_login  s*   z DefaultAccountAdapter.post_loginc                 C   sv   t |ds4ddlm} t }d }|D ]}t||r|} n
|s&t |dr&|}qd|j|jjg}||_	t
|| d S )Nbackendr   AuthenticationBackendget_user.)r   auth_backendsr  r   rk   rm   
__module__r  __name__r
  django_login)r>   r?   r   r  backendsr
  bbackend_pathrA   rA   rB   r     s   

zDefaultAccountAdapter.loginc                 C   s   t | d S r   )django_logoutr   rA   rA   rB   r	   	  s   zDefaultAccountAdapter.logoutc                 C   s   ddl m} |||S )z@
        Marks the email address as confirmed on the db
        r   )r   )allauth.account.internal.flowsr   verify_email)r>   r?   rY   r   rA   rA   rB   confirm_email  s   z#DefaultAccountAdapter.confirm_emailc                 C   s   | | |  dS )z1
        Sets the password for the user.
        N)r   r   )r>   r   r   rA   rA   rB   r     s   
z"DefaultAccountAdapter.set_passwordc              	   C   sR   g }t  }tjdddg}|D ]}z|j| || W q ty&   Y qw |S )Nr   r   r@   )r   r   r   _meta	get_fieldr   r   )r>   rF   User
candidates	candidaterA   rA   rB   get_user_search_fields  s   z,DefaultAccountAdapter.get_user_search_fieldsc                 C   sZ   ddl m} tj httjB }d|v r't|j	}|r|hnd }|||dS |||dS )Nr   )url_has_allowed_host_and_scheme*)allowed_hosts)
django.utils.httpr   r    r?   get_hostsetr   ALLOWED_HOSTSr   netloc)r>   r   r   r"  parsed_hostallowed_hostrA   rA   rB   is_safe_url,  s   
z!DefaultAccountAdapter.is_safe_urlc                 C   s   |  d||S )a_  
        Method intended to be overridden in case you need to customize the logic
        used to determine whether a user is permitted to request a password reset.
        For example, if you are enforcing something like "social only" authentication
        in your app, you may want to intervene here by checking `user.has_usable_password`

        z account/email/password_reset_key)r   )r>   r   r@   r    rA   rA   rB   send_password_reset_mail9  s   z.DefaultAccountAdapter.send_password_reset_mailc                 C   s   ddl m} |j| j|S )zq
        Method intended to be overridden in case the password reset email
        needs to be adjusted.
        r   flows)allauth.account.internalr-  password_resetget_reset_password_from_key_urlr?   )r>   keyr-  rA   rA   rB   r0  C  s   z5DefaultAccountAdapter.get_reset_password_from_key_urlc                 C   s   ddl m} |j||S )zConstructs the email confirmation (activation) url.

        Note that if you have architected your system such that email
        confirmations are sent outside of the request context `request`
        can be `None` here.
        r   r,  )r.  r-  r   get_email_verification_url)r>   r?   emailconfirmationr-  rA   rA   rB   get_email_confirmation_urlL  s   z0DefaultAccountAdapter.get_email_confirmation_urlc                 C   r   )NTrA   )r>   r?   rY   r  rA   rA   rB   should_send_confirmation_mailY  r   z3DefaultAccountAdapter.should_send_confirmation_mailc                 C   sH   ddl m} |jtj}|jtj}tj||d}| d|| d S )Nr   r,  )r?   
signup_urlpassword_reset_urlz$account/email/account_already_exists)	r.  r-  r  get_signup_urlr    r?   r/  get_reset_password_urlr   )r>   r@   r-  r6  r7  r   rA   rA   rB    send_account_already_exists_mail\  s   z6DefaultAccountAdapter.send_account_already_exists_mailc                 C   sb   d|j ji}tjr|d|ji n||j| ||d |r$d}nd}| ||j j| d S )Nr   code)r1  activate_urlz'account/email/email_confirmation_signupz account/email/email_confirmation)	rY   r   r   "EMAIL_VERIFICATION_BY_CODE_ENABLEDr~   r1  r4  r   r@   )r>   r?   r3  r  r   email_templaterA   rA   rB   send_confirmation_mailj  s   z,DefaultAccountAdapter.send_confirmation_mailc                 C   r   )Nr(   r#   r   rA   rA   rB   r        z+DefaultAccountAdapter.respond_user_inactivec                 C   r   )Naccount_email_verification_sentr#   r   rA   rA   rB   respond_email_verification_sent  r@  z5DefaultAccountAdapter.respond_email_verification_sentc                 K   s0   t |}|d|dd }dj|j|dS )Nr@   r9   r   z{site}:{login})rb   r   )r   rE   rH   r_   domain)r>   r?   credentialsrb   r   rA   rA   rB   _get_login_attempts_cache_key  s   z3DefaultAccountAdapter._get_login_attempts_cache_keyc                 K   s&   | j |fi |}tj|d|d d S )Nlogin_failedactionr1  )rE  r!   clearr>   r?   rD  	cache_keyrA   rA   rB   #_delete_login_attempts_cached_email  s   z9DefaultAccountAdapter._delete_login_attempts_cached_emailc                 K   s0   | j |fi |}tj|d|ds| dd S )NrF  rG  r3   )rE  r!   consumer   rJ  rA   rA   rB   pre_authenticate  s   
z&DefaultAccountAdapter.pre_authenticatec                 K   sv   ddl m} | j|fi | |  t|fi |}| }|p"|}|r0| j|fi | |S | j|fi | |S )z8Only authenticates, does not actually login. See `login`r   r  )allauth.account.auth_backendsr  rN  unstash_authenticated_userr   rL  authentication_failed)r>   r?   rD  r  r   alt_userrA   rA   rB   r     s   z"DefaultAccountAdapter.authenticatec                 K   s   d S r   rA   )r>   r?   rD  rA   rA   rB   rQ    r   z+DefaultAccountAdapter.authentication_failedc           	      C   st   ddl m} ddlm} d|i}||}|r||d< |j|}|r&||d< | jtjfi |}|d uo9|j	|j	kS )Nr   rL   )r   r   r9   r@   )
rP   rM   allauth.account.utilsr   rQ   get_primary_emailr   r    r?   rO   )	r>   r   r   rM   r   rD  r9   r@   reauth_userrA   rA   rB   reauthenticate  s   z$DefaultAccountAdapter.reauthenticatec                 C   s,   t |jddk|jdk|jddkgS )NHTTP_X_REQUESTED_WITHXMLHttpRequestr   HTTP_ACCEPT)anyMETArE   r   r   rA   rA   rB   is_ajax  s   zDefaultAccountAdapter.is_ajaxc                 C   s2   |j d}|r|dd }|S |j d}|S )NHTTP_X_FORWARDED_FOR,r   REMOTE_ADDR)r[  rE   split)r>   r?   x_forwarded_foriprA   rA   rB   get_client_ip  s   z#DefaultAccountAdapter.get_client_ipc                 C   s   |j ddS )NHTTP_USER_AGENTUnspecified)r[  rE   r   rA   rA   rB   get_http_user_agent  rD   z)DefaultAccountAdapter.get_http_user_agentc                 C   s   t d }|S )N@   )r   rH   )r>   r@   r1  rA   rA   rB   generate_emailconfirmation_key  s   z4DefaultAccountAdapter.generate_emailconfirmation_keyc                 C   sH   g }| d | d tjr"ddlm} | d |jr"| d |S )Nz'allauth.account.stages.LoginByCodeStagez-allauth.account.stages.EmailVerificationStager   r   z$allauth.mfa.stages.AuthenticateStagez.allauth.mfa.webauthn.stages.PasskeySignupStage)r   allauth_app_settingsMFA_ENABLEDallauth.mfar   PASSKEY_SIGNUP_ENABLED)r>   rF   mfa_settingsrA   rA   rB   get_login_stages  s   



z&DefaultAccountAdapter.get_login_stagesc                 C   s   ddl m} dd ||D }g }d|v r$dtdtdd}|| d	|v rX|d	 d
 }d|v s6d|v rEd	tdtd	d}|| d|v rXdtdtdd}|| |S )zThe order of the methods returned matters. The first method is the
        default when using the `@reauthentication_required` decorator.
        r   )get_reauthentication_flowsc                 S   s   i | ]}|d  |qS )idrA   )r   frA   rA   rB   r     s    zFDefaultAccountAdapter.get_reauthentication_methods.<locals>.<dictcomp>rV  zUse your passwordaccount_reauthenticate)rp  descriptionr   mfa_reauthenticatetypesrecovery_codestotpzUse authenticator app or codewebauthnzmfa_reauthenticate:webauthnzUse a security keymfa_reauthenticate_webauthn)/allauth.account.internal.flows.reauthenticationro  _r   r   )r>   r   ro  
flow_by_idrF   entryru  rA   rA   rB   get_reauthentication_methods  s0   


z2DefaultAccountAdapter.get_reauthentication_methodsc                 C   sn   ddl m} tjsd S |s|j|}|sd S t | | j	| 
| j	d}|r.|| | ||| d S )Nr   rL   )	timestamprb  
user_agent)rP   rM   r   EMAIL_NOTIFICATIONSrQ   rT  r   nowrc  r?   rf  r~   r   )r>   rt   r   r    r@   rM   r   rA   rA   rB   send_notification_mail  s   


z,DefaultAccountAdapter.send_notification_mailc                 C      |   S )z-
        Generates a new login code.
        _generate_codere   rA   rA   rB   generate_login_code     z)DefaultAccountAdapter.generate_login_codec                 C   r  )z:
        Generates a new email verification code.
        r  re   rA   rA   rB    generate_email_verification_code  r  z6DefaultAccountAdapter.generate_email_verification_codec                 C   s2   d}t jt j }|D ]}||d}q
td|dS )N0OI18B2ZAEUr      )lengthallowed_chars)stringascii_uppercasedigitsreplacer   )r>   forbidden_charsr  chrA   rA   rB   r    s
   z$DefaultAccountAdapter._generate_codec                 C   sd   ddl m} d}|| j}|r|d d }|dkrdS tj}t|tr&|S |s*dS |du p1||v S )z_
        Returns whether or not login-by-code is required for the given
        login.
        r   )authenticationNr   r;  F)allauth.accountr  get_authentication_recordsr?   r   LOGIN_BY_CODE_REQUIREDrk   bool)r>   r   r  r   recordsr   rA   rA   rB   is_login_by_code_required$  s   
z/DefaultAccountAdapter.is_login_by_code_requiredr   )T)F)NNr   N)NNN)rK   N)NN)Er  r  __qualname____doc__r{  r
   r  r  error_messagesrC   rG   rJ   r  r\   rl   rc   rf   r|   r   r   r   r   r   r   r   r   r   r%   r   r   r   r   r   r   r   r   r  r	  r   r	   r  r   r  r*  r+  r0  r4  r5  r:  r?  r   rB  rE  rL  rN  r   rQ  rV  r\  rc  rf  rh  rn  r~  r  r  r  r  r  rA   rA   rA   rB   r'   *   s    "!

(			





!"

			
#r'   c                 C   s   t tj| S r   )r&   r   ADAPTER)r?   rA   rA   rB   get_adapter9  rD   r  r   )Crj   r   r  r   urllib.parser   django.confr   django.contribr   django.contrib.authr   r   r   r   r  r	   r  django.contrib.auth.modelsr
   'django.contrib.auth.password_validationr   r   django.contrib.sites.shortcutsr   django.core.exceptionsr   django.core.mailr   r   django.httpr   r   django.shortcutsr   django.templater   django.template.loaderr   django.urlsr   django.utilsr   django.utils.cryptor   django.utils.encodingr   django.utils.translationr   r{  r   r   ri  r  r   allauth.corer    r!   allauth.core.internal.adapterr"   allauth.core.internal.httpkitr$   allauth.utilsr%   r&   r'   r  rA   rA   rA   rB   <module>   sH          