diff options
-rw-r--r-- | src/db.py | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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() |