增加清理无用测试数据的功能,同时更新部分文字颜色

This commit is contained in:
virusdefender
2016-01-26 16:39:30 +08:00
parent 991a96ddb7
commit 480050fac3
2 changed files with 40 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
# coding=utf-8
from django.core.management.base import BaseCommand, CommandError
from django.core.management.base import BaseCommand
from account.models import User, SUPER_ADMIN, UserProfile
from utils.shortcuts import rand_str
@@ -11,6 +11,6 @@ class Command(BaseCommand):
user.set_password(rand_password)
user.save()
UserProfile.objects.create(user=user)
self.stdout.write("Successfully created super admin user.\nUsername: root\nPassword: %s\n"
"Remember to change password and turn on two factors auth "
"after installation." % rand_password)
self.stdout.write(self.style.SUCCESS("Successfully created super admin user.\nUsername: root\nPassword: %s\n"
"Remember to change password and turn on two factors auth "
"after installation." % rand_password))