fix many bugs

This commit is contained in:
zema1
2017-10-31 16:33:25 +08:00
parent f0655ee305
commit aa4240790b
12 changed files with 62 additions and 35 deletions

View File

@@ -1,3 +1,4 @@
import os
from django.core.cache import cache
from django.db import transaction, IntegrityError
@@ -6,6 +7,11 @@ from utils.shortcuts import rand_str
from .models import SysOptions as SysOptionsModel
def default_token():
token = os.environ.get("JUDGE_SERVER_TOKEN")
return token if token else rand_str()
class OptionKeys:
website_base_url = "website_base_url"
website_name = "website_name"
@@ -25,7 +31,7 @@ class OptionDefaultValue:
allow_register = True
submission_list_show_all = True
smtp_config = {}
judge_server_token = rand_str
judge_server_token = default_token
class _SysOptionsMeta(type):