Ë
    ûûàg<  ã                   ór   — 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mZ d„ Zdd
„Zy	)é    ©Úwraps)Úmessages)ÚValidationError)ÚHttpResponseRedirect)Úreverse)Úget_adapter)ÚEmailAddressc                 óš   — t         j                  j                  | d¬«      j                  «        }|st	        «       j                  d«      ‚y)zÓ
    If we would allow users to enable 2FA with unverified email address,
    that would allow for an attacker to signup, not verify and prevent the real
    owner of the account from ever regaining access.
    F)ÚuserÚverifiedÚunverified_emailN)r
   ÚobjectsÚfilterÚexistsr	   Úvalidation_error)r   Úemail_verifieds     ú\/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/allauth/mfa/internal/flows/add.pyÚvalidate_can_add_authenticatorr      sG   € ô &×-Ñ-×4Ñ4¸$ÈÐ4ÓO×VÑVÓXÐX€NÙÜ‹m×,Ñ,Ð-?Ó@Ð@ð ó    Nc                 ó    — d„ }| r || «      S |S )Nc                 ó.   ‡ — t        ‰ «      ˆ fd„«       }|S )Nc                 óB  •— | j                   j                  r	 t        | j                   «        ‰| g|¢­i |¤ŽS # t        $ r[}|j                  D ].  }t        «       }|j                  | t        j                  |¬«       Œ0 t        t        d«      «      cY d }~S d }~ww xY w)N)ÚmessageÚ	mfa_index)
r   Úis_authenticatedr   r   r   Úget_account_adapterÚadd_messageÚERRORr   r   )ÚrequestÚargsÚkwargsÚer   ÚadapterÚ	view_funcs         €r   Ú_wrapper_viewzEredirect_if_add_not_allowed.<locals>.decorator.<locals>._wrapper_view   s•   ø€ à�|‰|×,Ò,ðFÜ2°7·<±<Ô@ñ ˜WÐ6 tÒ6¨vÑ6Ð6øô 'ò FØ#$§:¡:ò V˜Ü"5Ó"7˜Ø×+Ñ+¨G´X·^±^ÈWÐ+ÕUðVô 0´¸Ó0DÓEÕEûð	Fús   ™: º	BÁABÂBÂBr   )r%   r&   s   ` r   Ú	decoratorz.redirect_if_add_not_allowed.<locals>.decorator   s"   ø€ Ü	ˆyÓ	ó		7ó 
ð		7ð Ðr   © )Úfunctionr'   s     r   Úredirect_if_add_not_allowedr*      s   € òñ Ù˜Ó"Ð"ØÐr   )N)Ú	functoolsr   Údjango.contribr   Údjango.core.exceptionsr   Údjango.httpr   Údjango.urlsr   Úallauth.account.adapterr	   r   Úallauth.account.modelsr
   Úallauth.mfa.adapterr   r*   r(   r   r   ú<module>r3      s(   ðÝ å #Ý 2Ý ,Ý å FÝ /Ý +òAôr   