From 9e2b7f69562507c208512b3997b232fa495eb0d9 Mon Sep 17 00:00:00 2001 From: Timur Demin Date: Thu, 26 Dec 2019 18:21:10 +0500 Subject: [PATCH] Expose information on whether signup is allowed on the server --- project_amber/handlers/const.py | 1 + project_amber/handlers/misc.py | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/project_amber/handlers/const.py b/project_amber/handlers/const.py index d906a22..bfc0502 100644 --- a/project_amber/handlers/const.py +++ b/project_amber/handlers/const.py @@ -13,3 +13,4 @@ API_REMINDER = "reminder" API_QUERY = "query" API_VERSION = "version" +API_SIGNUP = "signup" diff --git a/project_amber/handlers/misc.py b/project_amber/handlers/misc.py index c9920e9..90d9ed0 100644 --- a/project_amber/handlers/misc.py +++ b/project_amber/handlers/misc.py @@ -1,8 +1,12 @@ from json import dumps +from project_amber.config import config from project_amber.const import VERSION -from project_amber.handlers.const import API_VERSION +from project_amber.handlers.const import API_VERSION, API_SIGNUP + +signup_allowed = False +if config["allow_signup"]: signup_allowed = True def version(): - return dumps({API_VERSION: VERSION}) + return dumps({API_VERSION: VERSION, API_SIGNUP: signup_allowed})