Created
September 17, 2015 13:47
-
-
Save fchevitarese/f110a4d7c37a328e2733 to your computer and use it in GitHub Desktop.
clean_method.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def clean(self, value): | |
# super(UserField, self).clean(value) | |
# instance = getattr(self, 'instance', None) | |
# if instance is None: | |
# try: | |
# User.objects.get(email=value) | |
# raise forms.ValidationError( | |
# "Someone is already using this email. Please pick an other.") | |
# except User.DoesNotExist: | |
# return value |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment