Compare commits
No commits in common. "295e8336214993c3126127cea420e847f714dc8b" and "99b180681ffa326bd98422e8902477c7e2c11ca0" have entirely different histories.
295e833621
...
99b180681f
|
@ -1,8 +1,9 @@
|
||||||
#!/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
|
||||||
from confarchive.view import app
|
|
||||||
|
|
||||||
app.config.from_object("config.default")
|
app.config.from_object("config.default")
|
||||||
database.init_app(app)
|
database.init_app(app)
|
|
@ -186,20 +186,9 @@ def merge() -> str | Response:
|
||||||
|
|
||||||
print(other_ids, "->", merge_to_id)
|
print(other_ids, "->", merge_to_id)
|
||||||
|
|
||||||
conference_people = model.ConferencePerson.query.filter(
|
|
||||||
model.ConferencePerson.person_id.in_(other_ids)
|
|
||||||
)
|
|
||||||
|
|
||||||
with database.session.begin():
|
with database.session.begin():
|
||||||
merge_to = model.Person.query.get(merge_to_id)
|
|
||||||
existing_conferences = {conf.id for conf in merge_to.conferences}
|
|
||||||
to_delete = [
|
|
||||||
cp for cp in conference_people if cp.conference_id in existing_conferences
|
|
||||||
]
|
|
||||||
for cp in to_delete:
|
|
||||||
database.session.delete(cp)
|
|
||||||
|
|
||||||
if merge_to_id != name_from_person_id:
|
if merge_to_id != name_from_person_id:
|
||||||
|
merge_to = model.Person.query.get(merge_to_id)
|
||||||
name_from_person = model.Person.query.get(name_from_person_id)
|
name_from_person = model.Person.query.get(name_from_person_id)
|
||||||
merge_to.name = name_from_person.name
|
merge_to.name = name_from_person.name
|
||||||
|
|
|
@ -1,55 +0,0 @@
|
||||||
#!/usr/bin/python3
|
|
||||||
|
|
||||||
import os
|
|
||||||
import json
|
|
||||||
from confarchive import database, model
|
|
||||||
from confarchive.view import app
|
|
||||||
|
|
||||||
app.config.from_object("config.default")
|
|
||||||
database.init_app(app)
|
|
||||||
|
|
||||||
|
|
||||||
def url_from_giggty_menu() -> None:
|
|
||||||
for conf in model.Conference.query.order_by(model.Conference.short_name):
|
|
||||||
if conf.url:
|
|
||||||
continue
|
|
||||||
|
|
||||||
giggity_menu = "giggity/menu/"
|
|
||||||
|
|
||||||
menu_filename = os.path.join(giggity_menu, conf.short_name + ".json")
|
|
||||||
|
|
||||||
if not os.path.exists(menu_filename):
|
|
||||||
continue
|
|
||||||
|
|
||||||
menu = json.load(open(menu_filename))
|
|
||||||
links = {link["title"]: link["url"] for link in menu["metadata"]["links"]}
|
|
||||||
|
|
||||||
if "Website" not in links:
|
|
||||||
continue
|
|
||||||
print(json.dumps(links, indent=2))
|
|
||||||
|
|
||||||
url = links["Website"]
|
|
||||||
|
|
||||||
print(conf.short_name, menu_filename, url)
|
|
||||||
|
|
||||||
conf.url = url
|
|
||||||
|
|
||||||
database.session.commit()
|
|
||||||
|
|
||||||
|
|
||||||
def add_more_urls() -> None:
|
|
||||||
for conf in model.Conference.query.order_by(model.Conference.short_name):
|
|
||||||
if conf.url:
|
|
||||||
continue
|
|
||||||
if conf.short_name.startswith("debconf"):
|
|
||||||
conf.url = f"https://{conf.short_name}.debconf.org/"
|
|
||||||
print(conf.short_name, conf.url)
|
|
||||||
if conf.short_name.startswith("fosdem"):
|
|
||||||
year = conf.short_name[-4:]
|
|
||||||
conf.url = f"https://fosdem.org/{year}/"
|
|
||||||
print(conf.short_name, conf.url)
|
|
||||||
|
|
||||||
database.session.commit()
|
|
||||||
|
|
||||||
|
|
||||||
add_more_urls()
|
|
Loading…
Reference in a new issue