diff --git a/add_place.py b/add_place.py index 61d0b92..41060d6 100755 --- a/add_place.py +++ b/add_place.py @@ -1,12 +1,12 @@ #!/usr/bin/python3 -from main import app import sys + from confarchive import database, model, wikidata +DB_URL = "postgresql:///confarchive" -app.config.from_object("config.default") -database.init_app(app) +database.init_db(DB_URL) def add_country(name: str) -> None: diff --git a/main.py b/main.py index f1e5990..63c3f1f 100755 --- a/main.py +++ b/main.py @@ -156,9 +156,7 @@ def search_people() -> str: q = model.Person.query.filter(model.Person.name.ilike(f"%{search_for}%")).order_by( model.Person.name ) - return flask.render_template( - "search_people.html", q=q, search_for=search_for, is_admin=check_admin_mode - ) + return flask.render_template("search_people.html", q=q, search_for=search_for) @app.route("/merge", methods=["GET", "POST"]) diff --git a/templates/search_people.html b/templates/search_people.html index c2017de..aabe7fe 100644 --- a/templates/search_people.html +++ b/templates/search_people.html @@ -20,7 +20,7 @@ {% set count = q.count() %} Found {{ count }} people matching '{{ search_for }}' - {% if is_admin() and count %} + {% if config.ADMIN_MODE and count %} merge {% endif %}