1
0
Fork 0
mirror of https://github.com/Lynnesbian/FediBooks/ synced 2024-11-25 16:48:58 +00:00

Compare commits

..

2 commits

Author SHA1 Message Date
38463fefb2 enable db unicode support 2019-09-10 22:21:22 +10:00
57278a65ba fix keyerror 2019-09-10 22:03:56 +10:00
3 changed files with 7 additions and 3 deletions

View file

@ -86,7 +86,9 @@ db = MySQLdb.connect(
host = cfg['db_host'], host = cfg['db_host'],
user=cfg['db_user'], user=cfg['db_user'],
passwd=cfg['db_pass'], passwd=cfg['db_pass'],
db=cfg['db_name'] db=cfg['db_name'],
use_unicode=True,
charset="utf8mb4"
) )
cursor = db.cursor() cursor = db.cursor()

View file

@ -11,7 +11,9 @@ db = MySQLdb.connect(
host = cfg['db_host'], host = cfg['db_host'],
user=cfg['db_user'], user=cfg['db_user'],
passwd=cfg['db_pass'], passwd=cfg['db_pass'],
db=cfg['db_name'] db=cfg['db_name'],
use_unicode=True,
charset="utf8mb4"
) )
print("Cleaning up database") print("Cleaning up database")

View file

@ -435,7 +435,7 @@ def bot_create():
return redirect(url_for("home"), 303) return redirect(url_for("home"), 303)
else: else:
if session['step'] == 4: if 'step' in session and session['step'] == 4:
try: try:
# test authentication # test authentication
client = Mastodon(client_id=session['client_id'], client_secret=session['client_secret'], api_base_url=session['instance']) client = Mastodon(client_id=session['client_id'], client_secret=session['client_secret'], api_base_url=session['instance'])