Пример #1
0
    def clean_old_user(self):
        old_user = self.cleaned_data.get('old_user')
        try:
            self._old_user_obj = Votante.get_votante(old_user)
        except Votante.DoesNotExist:
            raise forms.ValidationError('This user does not exist.')

        return old_user
Пример #2
0
    def clean_hashed(self):
        hashed = self.cleaned_data.get('hashed')
        try:
            self._votante_obj = Votante.get_votante(hashed)
        except Votante.DoesNotExist:
            raise forms.ValidationError('This user does not exist.')

        return hashed