fix many bugs
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user