rename website_footer ->footer

This commit is contained in:
virusdefender 2016-11-19 17:19:04 +08:00
parent 637baba71b
commit 294fd8b5b2
4 changed files with 24 additions and 4 deletions

View File

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.10 on 2016-11-19 08:57
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('conf', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='websiteconfig',
old_name='website_footer',
new_name='footer',
),
]

View File

@ -19,7 +19,7 @@ class WebsiteConfig(models.Model):
base_url = models.CharField(max_length=128, default="http://127.0.0.1")
name = models.CharField(max_length=32, default="Online Judge")
name_shortcut = models.CharField(max_length=32, default="oj")
website_footer = models.TextField(default="Online Judge Footer")
footer = models.TextField(default="Online Judge Footer")
# allow register
allow_register = models.BooleanField(default=True)
# submission list show all user's submission

View File

@ -29,7 +29,7 @@ class CreateEditWebsiteConfigSerializer(serializers.Serializer):
base_url = serializers.CharField(max_length=128)
name = serializers.CharField(max_length=32)
name_shortcut = serializers.CharField(max_length=32)
website_footer = serializers.CharField(max_length=1024)
footer = serializers.CharField(max_length=1024)
allow_register = serializers.BooleanField()
submission_list_show_all = serializers.BooleanField()

View File

@ -53,7 +53,7 @@ class WebsiteConfigAPITest(APITestCase):
user = self.create_super_admin()
url = self.reverse("website_config_api")
data = {"base_url": "http://test.com", "name": "test name",
"name_shortcut": "test oj", "website_footer": "<a>test</a>",
"name_shortcut": "test oj", "footer": "<a>test</a>",
"allow_register": True, "submission_list_show_all": False}
resp = self.client.post(url, data=data)
self.assertSuccess(resp)
@ -62,7 +62,7 @@ class WebsiteConfigAPITest(APITestCase):
user = self.create_super_admin()
url = self.reverse("website_config_api")
data = {"base_url": "http://test.com", "name": "test name",
"name_shortcut": "test oj", "website_footer": "<a>test</a>",
"name_shortcut": "test oj", "footer": "<a>test</a>",
"allow_register": True, "submission_list_show_all": False}
resp = self.client.post(url, data=data)
self.assertSuccess(resp)