perf: change initial passwd to ChangeMe

pull/13490/head
ibuler 2024-06-24 19:25:24 +08:00 committed by Bryan
parent 17d96669fe
commit ee258707c8
2 changed files with 3 additions and 3 deletions

View File

@ -319,7 +319,7 @@ class AuthPostCheckMixin:
@classmethod
def _check_passwd_is_too_simple(cls, user: User, password):
if user.is_superuser and password == 'admin':
if password == 'admin' or password == 'ChangeMe':
message = _('Your password is too simple, please change it for security')
url = cls.generate_reset_password_url_with_flash_msg(user, message=message)
raise errors.PasswordTooSimple(url)

View File

@ -27,8 +27,8 @@ def add_default_admin(apps, schema_editor):
db_alias = schema_editor.connection.alias
admin = user_model.objects.using(db_alias).create(
username="admin", name="Administrator",
email="admin@mycomany.com", role="Admin",
password=make_password("admin"),
email="admin@example.com", role="Admin",
password=make_password("ChangeMe"),
)
group_model = apps.get_model("users", "UserGroup")
default_group = group_model.objects.using(db_alias).get(name="Default")