From 286e7d076cfb7b4b0bdfc917de3020e6e89683f6 Mon Sep 17 00:00:00 2001 From: Ciaran McCormick Date: Thu, 2 Jun 2022 14:40:20 +0100 Subject: Fixed #33764 -- Deprecated BaseUserManager.make_random_password(). --- django/contrib/auth/base_user.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'django/contrib/auth/base_user.py') 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): -- cgit v1.3