Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Commit

Permalink
Disable signup by default
Browse files Browse the repository at this point in the history
  • Loading branch information
tdemin committed Jun 11, 2019
1 parent 7d0b5d4 commit ac6fb63
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion project_amber/app.py
Expand Up @@ -18,12 +18,14 @@
app.add_url_rule("/api/logout", "logout", logout, methods=["POST"])
app.add_url_rule("/api/login_check", "login_check", login_check, \
methods=["GET"])
app.add_url_rule("/api/signup", "signup", signup, methods=["POST"])
app.add_url_rule("/api/task", "task", handle_task_request, \
methods=["GET", "POST"])
app.add_url_rule("/api/task/<task_id>", "task_id", handle_task_id_request, \
methods=["GET", "PATCH", "DELETE"])

if config["allow_signup"]:
app.add_url_rule("/api/signup", "signup", signup, methods=["POST"])

@app.before_first_request
def create_tables():
db.create_all() # create all tables on first run
Expand Down
3 changes: 2 additions & 1 deletion project_amber/config.py
Expand Up @@ -8,7 +8,8 @@

config = {
"database": "",
"loglevel": 0
"loglevel": 0,
"allow_signup": False
}

# search for every file name and load the config from the first file
Expand Down

0 comments on commit ac6fb63

Please sign in to comment.