移除time_zone,修复problem越权

This commit is contained in:
zemal
2017-08-23 17:01:55 +08:00
parent 99fd87dbcf
commit 57ab7435af
10 changed files with 34 additions and 31 deletions

View File

@@ -11,7 +11,7 @@ class APITestCase(TestCase):
def create_user(self, username, password, admin_type=AdminType.REGULAR_USER, login=True, problem_permission=ProblemPermission.NONE):
user = User.objects.create(username=username, admin_type=admin_type, problem_permission=problem_permission)
user.set_password(password)
UserProfile.objects.create(user=user, time_zone="Asia/Shanghai")
UserProfile.objects.create(user=user)
user.save()
if login:
self.client.login(username=username, password=password)

View File

@@ -33,7 +33,7 @@ class Command(BaseCommand):
rand_password = "rootroot"
user.set_password(rand_password)
user.save()
UserProfile.objects.create(user=user, time_zone="Asia/Shanghai")
UserProfile.objects.create(user=user)
self.stdout.write(self.style.SUCCESS("Successfully created super admin user.\n"
"Username: root\nPassword: %s\n"
"Remember to change password and turn on two factors auth "