Implement MIT signups.

Here we introduce a new manage.py command, activate_mit, which takes a
number of usernames and sends out emails to the users with instructions on
how to activate their accounts.

(imported from commit f14401b55f915698e83ff27b86434f53e64685f3)
This commit is contained in:
Luke Faraone
2012-10-29 14:08:18 -04:00
parent 50e40d3f47
commit 5dad59e864
7 changed files with 117 additions and 8 deletions

View File

@@ -10,6 +10,13 @@ def is_unique(value):
except User.DoesNotExist:
pass
def is_active(value):
try:
if User.objects.get(email=value).is_active:
raise ValidationError(u'%s is already active' % value)
except User.DoesNotExist:
pass
class UniqueEmailField(forms.EmailField):
default_validators = [validators.validate_email, is_unique]