Skip to content

Commit e5a21ed

Browse files
committed
fix the inting
1 parent 51ad54f commit e5a21ed

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

tronbyt_server/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ def create_app(test_config: Optional[Dict[str, Any]] = None) -> Flask:
221221
PRODUCTION=os.getenv("PRODUCTION", "1"),
222222
DB_FILE="users/usersdb.sqlite",
223223
LANGUAGES=["en", "de"],
224-
MAX_USERS=os.getenv("MAX_USERS", 100),
224+
MAX_USERS=int(os.getenv("MAX_USERS", "100")),
225225
)
226226
if app.config.get("PRODUCTION") == "1":
227227
if app.config["SERVER_PROTOCOL"] == "https":
@@ -242,7 +242,7 @@ def create_app(test_config: Optional[Dict[str, Any]] = None) -> Flask:
242242
USERS_DIR="tests/users",
243243
DATA_DIR=os.getenv("DATA_DIR", "data"),
244244
PRODUCTION="0",
245-
MAX_USERS=os.getenv("MAX_USERS", 100),
245+
MAX_USERS=int(os.getenv("MAX_USERS", "100")),
246246
TESTING=True,
247247
)
248248
babel.init_app(app, locale_selector=get_locale)

tronbyt_server/auth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
@bp.route("/register", methods=("GET", "POST"))
2727
def register() -> ResponseReturnValue:
2828
# Check if max users limit is reached
29-
max_users = int(current_app.config.get("MAX_USERS")) # default to something big
29+
max_users = current_app.config.get("MAX_USERS", 100) # Default to 0 (unlimited)
3030
if max_users > 0:
3131
users_count = len(db.get_all_users())
3232
if users_count >= max_users:

0 commit comments

Comments
 (0)