o
    g-                     @   s8   d dl mZ d dlmZ d dlmZ G dd deZdS )    )PasswordResetForm)User)formsc                   @   s   e Zd ZdZdd ZdS )CustomPasswordResetFormz:Custom password reset form that validates email existence.c                 C   s*   | j d }tjj|d std|S )z/Validate that the email exists in our database.email)r   z4There is no user registered with this email address.)cleaned_datar   objectsfilterexistsr   ValidationError)selfr    r   9/var/www/html/bloggers_ems/events/forms/password_reset.pyclean_email   s   

z#CustomPasswordResetForm.clean_emailN)__name__
__module____qualname____doc__r   r   r   r   r   r      s    r   N)django.contrib.auth.formsr   django.contrib.auth.modelsr   djangor   r   r   r   r   r   <module>   s    