Commits

Matthew Schinckel committed 84183d0

Rollback unique email address stuff. That was an error.

Comments (0)

Files changed (2)

auth_additions/forms.py

             raise forms.ValidationError("That email address is in use. You may use <something>+email@example.com")
         return email
 
-class UserChangeForm(UserEmailUniqueMixin, UserChangeForm):
+class UserChangeForm(UserChangeForm):
     username = forms.RegexField(
         label=_(u"Username"),
         max_length=USERNAME_LENGTH,

auth_additions/models.py

     increase_field_length(field, 128)
 
 # Make email address unique
-field = User._meta.get_field_by_name('email')[0]
-field._unique = True
-field.default = None
-field.null = True
+# field = User._meta.get_field_by_name('email')[0]
+# field._unique = True
+# field.default = None
+# field.null = True
 
 # Allow nullable username
-field = User._meta.get_field_by_name('username')[0]
-field.default = None
-field.null = True
+# field = User._meta.get_field_by_name('username')[0]
+# field.default = None
+# field.null = True
 
-@receiver(models.signals.pre_save, sender=User)
-def User_pre_save(sender, instance, **kwargs):
-    """
-    Ensure that email is unique.
-    Nullify blank usernames.
-    """
-    if instance.username == "":
-        instance.username = None
-    if sender.objects.filter(email=instance.email).exclude(pk=instance.pk).exclude(email=None).exists():
-        raise ValidationError(_("Email must be unique"))
+# @receiver(models.signals.pre_save, sender=User)
+# def User_pre_save(sender, instance, **kwargs):
+#     """
+#     Ensure that email is unique.
+#     Nullify blank usernames.
+#     """
+#     if instance.username == "":
+#         instance.username = None
+#     if sender.objects.filter(email=instance.email).exclude(pk=instance.pk).exclude(email=None).exists():
+#         raise ValidationError(_("Email must be unique"))
 
 
 # Change the default represention of a User to contain fullname, and email/username.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.