aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/db.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/db.py b/src/db.py
index 8aa20f8..a6e29fd 100644
--- a/src/db.py
+++ b/src/db.py
@@ -13,7 +13,11 @@ def insert_file(conn, filename: str, expiration_days: int, content_length: int):
def get_file(conn, file_id: str):
cur = conn.cursor()
res = cur.execute(
- 'SELECT filename, expires, content_length FROM files WHERE id = ?',
+ '''
+ SELECT filename, expires, content_length
+ FROM files
+ WHERE id = ? AND expires > datetime()
+ ''',
(file_id,)
)
return res.fetchone()