Compare commits
2 commits
662fdcaa2b
...
99b180681f
Author | SHA1 | Date | |
---|---|---|---|
Edward Betts | 99b180681f | ||
Edward Betts | 6e50f9ad74 |
|
@ -1,12 +1,12 @@
|
||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
|
|
||||||
|
from main import app
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from confarchive import database, model, wikidata
|
from confarchive import database, model, wikidata
|
||||||
|
|
||||||
DB_URL = "postgresql:///confarchive"
|
|
||||||
|
|
||||||
database.init_db(DB_URL)
|
app.config.from_object("config.default")
|
||||||
|
database.init_app(app)
|
||||||
|
|
||||||
|
|
||||||
def add_country(name: str) -> None:
|
def add_country(name: str) -> None:
|
||||||
|
|
4
main.py
4
main.py
|
@ -156,7 +156,9 @@ def search_people() -> str:
|
||||||
q = model.Person.query.filter(model.Person.name.ilike(f"%{search_for}%")).order_by(
|
q = model.Person.query.filter(model.Person.name.ilike(f"%{search_for}%")).order_by(
|
||||||
model.Person.name
|
model.Person.name
|
||||||
)
|
)
|
||||||
return flask.render_template("search_people.html", q=q, search_for=search_for)
|
return flask.render_template(
|
||||||
|
"search_people.html", q=q, search_for=search_for, is_admin=check_admin_mode
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@app.route("/merge", methods=["GET", "POST"])
|
@app.route("/merge", methods=["GET", "POST"])
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
{% set count = q.count() %}
|
{% set count = q.count() %}
|
||||||
Found {{ count }} people matching '{{ search_for }}'
|
Found {{ count }} people matching '{{ search_for }}'
|
||||||
|
|
||||||
{% if config.ADMIN_MODE and count %}
|
{% if is_admin() and count %}
|
||||||
<a href="{{ url_for("merge", q=search_for) }}">merge</a>
|
<a href="{{ url_for("merge", q=search_for) }}">merge</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</p>
|
</p>
|
||||||
|
|
Loading…
Reference in a new issue