暂停注册的功能

This commit is contained in:
BennyThink
2022-03-26 10:14:26 +08:00
parent faa15c93d6
commit 24e7483c62
2 changed files with 4 additions and 1 deletions

Submodule YYeTsFE updated: c65f7784d8...b2792904c4

View File

@@ -721,6 +721,9 @@ class UserMongoResource(UserResource, Mongo):
returned_value["message"] = "用户名或密码错误"
else:
if os.getenv("DISABLE_REGISTER"):
return {"status_code": HTTPStatus.BAD_REQUEST, "message": "本站已经暂停注册"}
# register
hash_value = pbkdf2_sha256.hash(password)
try: