Update app.py
Browse files
app.py
CHANGED
@@ -241,7 +241,7 @@ def store():
|
|
241 |
"id": secret_id,
|
242 |
"short_id": short_id,
|
243 |
"short_url": f"{base_url}/s/{short_id}",
|
244 |
-
"qr_code": qr_code,
|
245 |
"expires_at": SECRETS[secret_id]["expire_at"],
|
246 |
"has_file": file_data is not None
|
247 |
})
|
@@ -287,7 +287,7 @@ def fetch(secret_id):
|
|
287 |
"access_count": secret["access_count"]
|
288 |
}
|
289 |
|
290 |
-
# Include file data if present
|
291 |
if secret.get("file_data"):
|
292 |
response["file_data"] = secret["file_data"]
|
293 |
response["file_type"] = secret.get("file_type", "unknown")
|
@@ -295,13 +295,6 @@ def fetch(secret_id):
|
|
295 |
|
296 |
# Handle view-once deletion
|
297 |
if secret["view_once"]:
|
298 |
-
# Schedule deletion after delay
|
299 |
-
delay = secret.get("delay_seconds", 0)
|
300 |
-
if delay > 0:
|
301 |
-
# In a production environment, you'd use a task queue like Celery
|
302 |
-
# For now, we'll delete immediately after response
|
303 |
-
pass
|
304 |
-
|
305 |
# Delete the secret
|
306 |
del SECRETS[secret_id]
|
307 |
|
|
|
241 |
"id": secret_id,
|
242 |
"short_id": short_id,
|
243 |
"short_url": f"{base_url}/s/{short_id}",
|
244 |
+
"qr_code": qr_code, # This was already there - make sure it's returned
|
245 |
"expires_at": SECRETS[secret_id]["expire_at"],
|
246 |
"has_file": file_data is not None
|
247 |
})
|
|
|
287 |
"access_count": secret["access_count"]
|
288 |
}
|
289 |
|
290 |
+
# Include file data if present - THIS WAS THE MAIN ISSUE
|
291 |
if secret.get("file_data"):
|
292 |
response["file_data"] = secret["file_data"]
|
293 |
response["file_type"] = secret.get("file_type", "unknown")
|
|
|
295 |
|
296 |
# Handle view-once deletion
|
297 |
if secret["view_once"]:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
298 |
# Delete the secret
|
299 |
del SECRETS[secret_id]
|
300 |
|