Skip to content

Commit fb310b1

Browse files
authored
Add "django.contrib.auth.management.commands.createsuperuser" annotations (#2701)
1 parent b59fc98 commit fb310b1

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
import getpass as getpass
22
from typing import Any
33

4+
from django.contrib.auth.base_user import AbstractBaseUser
45
from django.core.management.base import BaseCommand
6+
from django.db.models import Field
7+
from django.utils.functional import cached_property
58

69
class NotRunningInTTYException(Exception): ...
710

11+
PASSWORD_FIELD: str
12+
813
class Command(BaseCommand):
14+
UserModel: type[AbstractBaseUser]
15+
username_field: Field
916
stdin: Any
17+
def get_input_data(self, field: Field, message: str, default: str | None = ...) -> str | None: ...
18+
@cached_property
19+
def username_is_unique(self) -> bool: ...

scripts/stubtest/allowlist_todo.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,6 @@ django.contrib.auth.hashers.Argon2PasswordHasher.params
5757
django.contrib.auth.hashers.ScryptPasswordHasher
5858
django.contrib.auth.hashers.must_update_salt
5959
django.contrib.auth.hashers.reset_hashers
60-
django.contrib.auth.management.commands.createsuperuser.Command.get_input_data
61-
django.contrib.auth.management.commands.createsuperuser.Command.username_is_unique
62-
django.contrib.auth.management.commands.createsuperuser.PASSWORD_FIELD
6360
django.contrib.auth.models.AbstractBaseUser.last_login
6461
django.contrib.auth.models.AbstractBaseUser.password
6562
django.contrib.auth.models.AbstractUser.date_joined

0 commit comments

Comments
 (0)