diff options
Diffstat (limited to 'django/contrib/auth/base_user.py')
| -rw-r--r-- | django/contrib/auth/base_user.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/django/contrib/auth/base_user.py b/django/contrib/auth/base_user.py index f6de3b9317..5ee30bf59c 100644 --- a/django/contrib/auth/base_user.py +++ b/django/contrib/auth/base_user.py @@ -3,6 +3,7 @@ This module allows importing AbstractBaseUser even when django.contrib.auth is not in INSTALLED_APPS. """ import unicodedata +import warnings from django.contrib.auth import password_validation from django.contrib.auth.hashers import ( @@ -12,6 +13,7 @@ from django.contrib.auth.hashers import ( ) from django.db import models from django.utils.crypto import get_random_string, salted_hmac +from django.utils.deprecation import RemovedInDjango51Warning from django.utils.translation import gettext_lazy as _ @@ -40,6 +42,11 @@ class BaseUserManager(models.Manager): allowed_chars. The default value of allowed_chars does not have "I" or "O" or letters and digits that look similar -- just to avoid confusion. """ + warnings.warn( + "BaseUserManager.make_random_password() is deprecated.", + category=RemovedInDjango51Warning, + stacklevel=2, + ) return get_random_string(length, allowed_chars) def get_by_natural_key(self, username): |
