diff options
Diffstat (limited to 'backend')
| -rw-r--r-- | backend/notif.py | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/backend/notif.py b/backend/notif.py index 92fe777..db7e0d3 100644 --- a/backend/notif.py +++ b/backend/notif.py @@ -19,7 +19,6 @@ f.close() cursor.execute(""" CREATE TABLE IF NOT EXISTS subscriptions ( endpoint TEXT PRIMARY KEY, - expiration_time REAL, keys_p256dh TEXT NOT NULL, keys_auth TEXT NOT NULL );""") @@ -27,15 +26,9 @@ CREATE TABLE IF NOT EXISTS subscriptions ( # --- subscribe def subscribe(data: PushSubscriptionData): - if data.expirationTime: - print("data.expirationTime exists", data.expirationTime) - cursor.execute(""" - INSERT INTO subscriptions (endpoint, expiration_time, keys_p256dh, keys_auth) - VALUES (?, ?, ?, ?)""", (data.endpoint, data.expirationTime, data.keys["p256dh"], data.keys["auth"])) - else: - cursor.execute(""" - INSERT INTO subscriptions (endpoint, keys_p256dh, keys_auth) - VALUES (?, ?, ?, ?)""", (data.endpoint, data.keys["p256dh"], data.keys["auth"])) + cursor.execute(""" + INSERT INTO subscriptions (endpoint, keys_p256dh, keys_auth) + VALUES (?, ?, ?, ?)""", (data.endpoint, data.keys["p256dh"], data.keys["auth"])) conn.commit() return data.endpoint |
