From 140ae5d7070e1ec990e5b03d65712f04ed5e947a Mon Sep 17 00:00:00 2001 From: pstruebi Date: Wed, 15 Jun 2022 20:45:03 +0200 Subject: [PATCH] add debugging in case of wrong event id --- app.py | 7 +++++++ calendar_interface.py | 5 ++--- config.py | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app.py b/app.py index 99109dc..3002dac 100644 --- a/app.py +++ b/app.py @@ -44,6 +44,13 @@ def index(): @auth.login_required def show_event(id): event = calendar_interface.get_calendar_event(id) + + if "error" in event: + print("id:", id) + logging.error("Found error in event query with id\n%s", event) + logging.error(json.dumps(event, indent=2)) + abort(404) + calendar_interface.convert_datetime(event) attendees= ", ".join( diff --git a/calendar_interface.py b/calendar_interface.py index 00f3240..a26d424 100644 --- a/calendar_interface.py +++ b/calendar_interface.py @@ -212,6 +212,7 @@ if __name__ == "__main__": #print(json.dumps(events, indent=2)) convert_datetimes(events) + convert_datetime(events[0]) print(json.dumps([(e["subject"], e["start"], e["duration"], e["attendees"], e["id"]) for e in events], indent=2)) @@ -244,9 +245,7 @@ if __name__ == "__main__": print(json.dumps(ret, indent=2)) if args.send_test_email: - with open("templates/auth/activate.html") as f: - content=f.read() - print(send_mail("struebin.patrick@gmail.com", "test test", content)) + print(send_mail("struebin.patrick@gmail.com", "test test", "bla")) print("Done.") \ No newline at end of file diff --git a/config.py b/config.py index f1f2417..200c07c 100644 --- a/config.py +++ b/config.py @@ -11,7 +11,7 @@ class Config(DefaultConfig): class ProductionConfig(Config): SECRET_KEY = '\xacI4\x077\x16?Q\xb4")\xdb\x066\x95\x11i\x0b\x0c&\xb6rP\'' SECURITY_PASSWORD_SALT = '>\xe3\x9bz\xfd\xbc[\xe22\xcfK\xca\x88!\xd8\xd5,\xd0\x95\x0c\x02\xad\xfa\x9d' - DATABASE_URI = 'mysql://user@localhost/foo' + DATABASE_URI = '/home/site/wwwroot/users.db' # For azure app services. The content under wwwroot is durable, unless you delete your app service. class DevelopmentConfig(Config): DEBUG = True