mirror of
https://github.com/QingdaoU/OnlineJudge.git
synced 2025-01-01 01:52:02 +00:00
初始化管理员用户的时候,由判断 root 用户名是否存在改为是否有用户存在
防止 root 用户被改名之后创建重复的 root 用户的问题
This commit is contained in:
parent
f94223e5c9
commit
a5722d9f2e
@ -20,7 +20,7 @@ class Command(BaseCommand):
|
|||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
if action == "create_super_admin":
|
if action == "create_super_admin":
|
||||||
if User.objects.filter(username=username).exists():
|
if User.objects.filter(id=1).exists():
|
||||||
self.stdout.write(self.style.SUCCESS(f"User {username} exists, operation ignored"))
|
self.stdout.write(self.style.SUCCESS(f"User {username} exists, operation ignored"))
|
||||||
exit()
|
exit()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user