fix
This commit is contained in:
@@ -26,6 +26,7 @@ class CreateEditWebsiteConfigSerializer(serializers.Serializer):
|
|||||||
website_footer = serializers.CharField(max_length=1024 * 1024)
|
website_footer = serializers.CharField(max_length=1024 * 1024)
|
||||||
allow_register = serializers.BooleanField()
|
allow_register = serializers.BooleanField()
|
||||||
submission_list_show_all = serializers.BooleanField()
|
submission_list_show_all = serializers.BooleanField()
|
||||||
|
class_list = serializers.ListField(child=serializers.CharField(max_length=64))
|
||||||
|
|
||||||
|
|
||||||
class JudgeServerSerializer(serializers.ModelSerializer):
|
class JudgeServerSerializer(serializers.ModelSerializer):
|
||||||
|
|||||||
@@ -99,6 +99,7 @@ class OptionKeys:
|
|||||||
website_footer = "website_footer"
|
website_footer = "website_footer"
|
||||||
allow_register = "allow_register"
|
allow_register = "allow_register"
|
||||||
submission_list_show_all = "submission_list_show_all"
|
submission_list_show_all = "submission_list_show_all"
|
||||||
|
class_list = "class_list"
|
||||||
smtp_config = "smtp_config"
|
smtp_config = "smtp_config"
|
||||||
judge_server_token = "judge_server_token"
|
judge_server_token = "judge_server_token"
|
||||||
throttling = "throttling"
|
throttling = "throttling"
|
||||||
@@ -112,6 +113,7 @@ class OptionDefaultValue:
|
|||||||
website_footer = "Online Judge Footer"
|
website_footer = "Online Judge Footer"
|
||||||
allow_register = True
|
allow_register = True
|
||||||
submission_list_show_all = True
|
submission_list_show_all = True
|
||||||
|
class_list = []
|
||||||
smtp_config = {}
|
smtp_config = {}
|
||||||
judge_server_token = default_token
|
judge_server_token = default_token
|
||||||
throttling = {"ip": {"capacity": 100, "fill_rate": 0.1, "default_capacity": 50},
|
throttling = {"ip": {"capacity": 100, "fill_rate": 0.1, "default_capacity": 50},
|
||||||
@@ -229,6 +231,14 @@ class _SysOptionsMeta(type):
|
|||||||
def submission_list_show_all(cls, value):
|
def submission_list_show_all(cls, value):
|
||||||
cls._set_option(OptionKeys.submission_list_show_all, value)
|
cls._set_option(OptionKeys.submission_list_show_all, value)
|
||||||
|
|
||||||
|
@my_property(ttl=DEFAULT_SHORT_TTL)
|
||||||
|
def class_list(cls):
|
||||||
|
return cls._get_option(OptionKeys.class_list)
|
||||||
|
|
||||||
|
@class_list.setter
|
||||||
|
def class_list(cls, value):
|
||||||
|
cls._set_option(OptionKeys.class_list, value)
|
||||||
|
|
||||||
@my_property
|
@my_property
|
||||||
def smtp_config(cls):
|
def smtp_config(cls):
|
||||||
return cls._get_option(OptionKeys.smtp_config)
|
return cls._get_option(OptionKeys.smtp_config)
|
||||||
|
|||||||
Reference in New Issue
Block a user