I can't think of a reason not to make the suggested change. It seems like an odd requirement if a site *requires* allowing new usernames to be case-sensitive.
Which is? Following the ticket I do not see any clear consenus at all. Imo Registration apps should handle that, which is not something Django ships with. I am -0 on changing the admin to disallow such users.
--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/acbbb18a-45f1-4147-bbd4-cb7e4bd1b3ab%40googlegroups.com.
The suggested change is to not allow a new user if there's a username__iexact match.
--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/650405a3-c860-4d84-be94-5b6a6c779aa2%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/a7c3add7-d13d-4b5c-af73-ac74cbc1c6a0%40googlegroups.com.
diff --git a/django/contrib/auth/base_user.py b/django/contrib/auth/base_user.pyindex 34dd6ac2f2..748db8bf89 100644--- a/django/contrib/auth/base_user.py+++ b/django/contrib/auth/base_user.py@@ -4,6 +4,7 @@ not in INSTALLED_APPS. """ import unicodedata +from django.core.exceptions import MultipleObjectsReturned from django.contrib.auth import password_validation from django.contrib.auth.hashers import ( check_password, is_password_usable, make_password,@@ -41,7 +42,14 @@ class BaseUserManager(models.Manager): return get_random_string(length, allowed_chars) def get_by_natural_key(self, username):- return self.get(**{self.model.USERNAME_FIELD: username})+ username_field = self.model.USERNAME_FIELD++ # Try case-insensitive match of username.+ # If there are multiple possiblities fallback to case-sensitive lookup+ try:+ return self.get(**{username_field + '__iexac': username})+ except MultipleObjectsReturned:+ return self.get(**{username_field: username}) class AbstractBaseUser(models.Model):
--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscribe@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/cc07fa69-06b3-4d24-aa2c-e5201ebe936a%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.
diff --git a/django/contrib/auth/base_user.py b/django/contrib/auth/base_user.pyindex 34dd6ac2f2..748db8bf89 100644--- a/django/contrib/auth/base_user.py+++ b/django/contrib/auth/base_user.py@@ -4,6 +4,7 @@ not in INSTALLED_APPS."""import unicodedata+from django.core.exceptions import MultipleObjectsReturnedfrom django.contrib.auth import password_validationfrom django.contrib.auth.hashers import (check_password, is_password_usable, make_password,@@ -41,7 +42,14 @@ class BaseUserManager(models.Manager):return get_random_string(length, allowed_chars)def get_by_natural_key(self, username):- return self.get(**{self.model.USERNAME_FIELD: username})+ username_field = self.model.USERNAME_FIELD++ # Try case-insensitive match of username.+ # If there are multiple possiblities fallback to case-sensitive lookup+ try:+ return self.get(**{username_field + '__iexac': username})+ except MultipleObjectsReturned:+ return self.get(**{username_field: username})class AbstractBaseUser(models.Model):
--
You received this message because you are subscribed to a topic in the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-developers/a4I7rHuT4Dw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-developers+unsubscribe@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAMGFDKQaa4RX31yJqOapRvehH8GBPObybJmLCJ44JqT0OZpqFA%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/3b6d56fd-2664-4b56-8712-e76d51c73172%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CABD5YeFm3A2k7V8zeRPBxyu8zMv7msnmU1ogS_SrCJT76H_Fzw%40mail.gmail.com.
RFC 5321, the standard that defines how email transport works, lays down the email address case sensitivity issue thus:
The local-part of a mailbox MUST BE treated as case sensitive. Therefore, SMTP implementations MUST take care to preserve the case of mailbox local-parts. In particular, for some hosts, the user "smith" is different from the user "Smith". However, exploiting the case sensitivity of mailbox local-parts impedes interoperability and is discouraged. Mailbox domains follow normal DNS rules and are hence not case sensitive.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CANK-ykkFovkYbB921%2BH5yejZFv6CehLnzmQcqZ4EPKr7WRUjww%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAB5Hk3zUYmYy9BFkFJcb9qWiumEXhY1TiqQQGQn5JS2SPqizJA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/1546725419.1509232.1626493552.759DCF29%40webmail.messagingengine.com.