summaryrefslogtreecommitdiff
path: root/django/contrib/auth/base_user.py
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2023-09-11 21:57:31 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2023-09-18 22:12:40 +0200
commit00e187961059a0e77403151d2bb38c217101d5af (patch)
tree085b1e7ce0aa801cc6d13e050ffa126a079feb5a /django/contrib/auth/base_user.py
parent295467c04ab4c26a1a9d3798b1e941003fa116cf (diff)
Refs #33764 -- Removed BaseUserManager.make_random_password() per deprecation timeline.
Diffstat (limited to 'django/contrib/auth/base_user.py')
-rw-r--r--django/contrib/auth/base_user.py21
1 files changed, 1 insertions, 20 deletions
diff --git a/django/contrib/auth/base_user.py b/django/contrib/auth/base_user.py
index da0eac731f..aa8e9f8a84 100644
--- a/django/contrib/auth/base_user.py
+++ b/django/contrib/auth/base_user.py
@@ -3,7 +3,6 @@ This module allows importing AbstractBaseUser even when django.contrib.auth is
not in INSTALLED_APPS.
"""
import unicodedata
-import warnings
from django.conf import settings
from django.contrib.auth import password_validation
@@ -14,8 +13,7 @@ from django.contrib.auth.hashers import (
make_password,
)
from django.db import models
-from django.utils.crypto import get_random_string, salted_hmac
-from django.utils.deprecation import RemovedInDjango51Warning
+from django.utils.crypto import salted_hmac
from django.utils.translation import gettext_lazy as _
@@ -34,23 +32,6 @@ class BaseUserManager(models.Manager):
email = email_name + "@" + domain_part.lower()
return email
- def make_random_password(
- self,
- length=10,
- allowed_chars="abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789",
- ):
- """
- Generate a random password with the given length and given
- 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):
return self.get(**{self.model.USERNAME_FIELD: username})