o
    gëf5  ã                   @   s   d dl mZ G dd„ deƒZG dd„ deƒZG dd„ deƒZG dd	„ d	eƒZG d
d„ deƒZG dd„ deƒZG dd„ deƒZ	G dd„ deƒZ
G dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZd S )!é    ©Úugettextc                   @   ó   e Zd ZdZdS )ÚSocialAuthBaseExceptionz#Base class for pipeline exceptions.N©Ú__name__Ú
__module__Ú__qualname__Ú__doc__© r   r   úW/var/www/html/humari/django-venv/lib/python3.10/site-packages/social_auth/exceptions.pyr      ó    r   c                   @   s   e Zd Zdd„ ZdS )ÚBackendErrorc                 C   s   t d| j ƒS )NzBackend error: %s)r   Úmessage©Úselfr   r   r   Ú__unicode__	   ó   zBackendError.__unicode__N)r   r   r	   r   r   r   r   r   r      s    r   c                   @   s   e Zd Zdd„ Zdd„ ZdS )ÚWrongBackendc                 C   s
   || _ d S ©N)Úbackend_name)r   r   r   r   r   Ú__init__   s   
zWrongBackend.__init__c                 C   ó   t dƒ| j S )Nz%Incorrect authentication service "%s")r   r   r   r   r   r   r      s   ÿzWrongBackend.__unicode__N)r   r   r	   r   r   r   r   r   r   r      s    r   c                   @   r   )ÚNotAllowedToDisconnectz6User is not allowed to disconnect it's social account.Nr   r   r   r   r   r      r   r   c                   @   ó   e Zd ZdZdd„ ZdS )ÚStopPipelinezhStop pipeline process exception.
    Raise this exception to stop the rest of the pipeline process.
    c                 C   ó   t dƒS )NzStop pipeliner   r   r   r   r   r      ó   zStopPipeline.__unicode__N©r   r   r	   r
   r   r   r   r   r   r      s    r   c                       ó    e Zd ZdZ‡ fdd„Z‡  ZS )ÚAuthExceptionzAuth process exception.c                    s    || _ tt| ƒj|i |¤Ž d S r   )ÚbackendÚsuperr    r   )r   r!   ÚargsÚkwargs©Ú	__class__r   r   r   $   s   zAuthException.__init__)r   r   r	   r
   r   Ú__classcell__r   r   r%   r   r    "   ó    r    c                       r   )Ú
AuthFailedz$Auth process failed for some reason.c                    s(   | j dkr	tdƒS tdƒtt| ƒ ¡  S )NÚaccess_deniedz$Authentication process was cancelledzAuthentication failed: %s)r   r   r"   r)   r   r   r%   r   r   r   +   s
   
ÿzAuthFailed.__unicode__©r   r   r	   r
   r   r'   r   r   r%   r   r)   )   r(   r)   c                   @   r   )ÚAuthCanceledz"Auth process was canceled by user.c                 C   r   )NzAuthentication process canceledr   r   r   r   r   r   5   r   zAuthCanceled.__unicode__Nr   r   r   r   r   r,   3   ó    r,   c                       r   )ÚAuthUnknownErrorzUnknown auth process error.c                    s   d}t |ƒtt| ƒ ¡  S )Nz1An unknown error happened while authenticating %s)r   r"   r.   r   )r   Úerrr%   r   r   r   ;   s   zAuthUnknownError.__unicode__r+   r   r   r%   r   r.   9   r(   r.   c                       r   )ÚAuthTokenErrorzAuth token error.c                    s   t t| ƒ ¡ }tdƒ| S )NzToken error: %s)r"   r0   r   r   )r   Úmsgr%   r   r   r   B   s   zAuthTokenError.__unicode__r+   r   r   r%   r   r0   @   r(   r0   c                       s(   e Zd ZdZ‡ fdd„Zdd„ Z‡  ZS )ÚAuthMissingParameterz:Missing parameter needed to start or complete the process.c                    s(   || _ tt| ƒj|g|¢R i |¤Ž d S r   )Ú	parameterr"   r2   r   )r   r!   r3   r#   r$   r%   r   r   r   I   s   "zAuthMissingParameter.__init__c                 C   r   )NzMissing needed parameter %s)r   r3   r   r   r   r   r   M   r   z AuthMissingParameter.__unicode__)r   r   r	   r
   r   r   r'   r   r   r%   r   r2   G   s    r2   c                   @   r   )ÚAuthStateMissingúState parameter is incorrect.c                 C   r   )NzSession value state missing.r   r   r   r   r   r   S   r   zAuthStateMissing.__unicode__Nr   r   r   r   r   r4   Q   r-   r4   c                   @   r   )ÚAuthStateForbiddenr5   c                 C   r   )NzWrong state parameter given.r   r   r   r   r   r   Y   r   zAuthStateForbidden.__unicode__Nr   r   r   r   r   r6   W   r-   r6   c                   @   r   )ÚAuthAlreadyAssociatedzAA different user has already associated the target social accountNr   r   r   r   r   r7   ]   r   r7   c                   @   r   )ÚAuthTokenRevokedz.User revoked the access_token in the provider.c                 C   r   )NzUser revoke access to the tokenr   r   r   r   r   r   d   r   zAuthTokenRevoked.__unicode__Nr   r   r   r   r   r8   b   r-   r8   N)Údjango.utils.translationr   Ú
ValueErrorr   r   r   r   r   r    r)   r,   r.   r0   r2   r4   r6   r7   r8   r   r   r   r   Ú<module>   s     	

