from django import forms
from .models import User

class User(forms.ModelForm):
    password = forms.CharField(widget=forms.PasswordInput())
    confirm_password = forms.CharField(widget=forms.PasswordInput())

    class Meta:
        model = User
        fields = ('first_name', 'last_name', 'email')

    def clean(self):
        cleaned_data = super(User, self).clean()
        password = cleaned_data.get("password")
        confirm_password = cleaned_data.get("confirm_password")

        if password != confirm_password:
            raise forms.ValidationError(
                "password and confirm_password does not match"
            )
3ee97c16a38c38d5a6892e7b9653275ed3f11804
<mask token>


class User(forms.ModelForm):
    <mask token>
    <mask token>


    class Meta:
        model = User
        fields = 'first_name', 'last_name', 'email'
    <mask token>

<mask token>


class User(forms.ModelForm):
    <mask token>
    <mask token>


    class Meta:
        model = User
        fields = 'first_name', 'last_name', 'email'

    def clean(self):
        cleaned_data = super(User, self).clean()
        password = cleaned_data.get('password')
        confirm_password = cleaned_data.get('confirm_password')
        if password != confirm_password:
            raise forms.ValidationError(
                'password and confirm_password does not match')

<mask token>


class User(forms.ModelForm):
    password = forms.CharField(widget=forms.PasswordInput())
    confirm_password = forms.CharField(widget=forms.PasswordInput())


    class Meta:
        model = User
        fields = 'first_name', 'last_name', 'email'

    def clean(self):
        cleaned_data = super(User, self).clean()
        password = cleaned_data.get('password')
        confirm_password = cleaned_data.get('confirm_password')
        if password != confirm_password:
            raise forms.ValidationError(
                'password and confirm_password does not match')

from django import forms
from .models import User


class User(forms.ModelForm):
    password = forms.CharField(widget=forms.PasswordInput())
    confirm_password = forms.CharField(widget=forms.PasswordInput())


    class Meta:
        model = User
        fields = 'first_name', 'last_name', 'email'

    def clean(self):
        cleaned_data = super(User, self).clean()
        password = cleaned_data.get('password')
        confirm_password = cleaned_data.get('confirm_password')
        if password != confirm_password:
            raise forms.ValidationError(
                'password and confirm_password does not match')

from django import forms
from .models import User

class User(forms.ModelForm):
    password = forms.CharField(widget=forms.PasswordInput())
    confirm_password = forms.CharField(widget=forms.PasswordInput())

    class Meta:
        model = User
        fields = ('first_name', 'last_name', 'email')

    def clean(self):
        cleaned_data = super(User, self).clean()
        password = cleaned_data.get("password")
        confirm_password = cleaned_data.get("confirm_password")

        if password != confirm_password:
            raise forms.ValidationError(
                "password and confirm_password does not match"
            )