From da4a5d2962bcd2f5f8d9bec0c3fafca4fef211b6 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Saad-Dupuy Date: Mon, 7 Jul 2014 02:00:45 +0200 Subject: [PATCH] fix(burn_after_reading): fixes burn after reading deletion --- zerobin/routes.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/zerobin/routes.py b/zerobin/routes.py index 3b2f4e0..a76ddcb 100644 --- a/zerobin/routes.py +++ b/zerobin/routes.py @@ -104,7 +104,12 @@ def display_paste(paste_id): keep_alive = False try: paste = Paste.load(paste_id) - if not paste.is_alive(): + # check for burn notice and is alive for the redirection + if paste.is_burn_notice: + keep_alive = paste.is_alive + if not keep_alive: + paste.delete() + elif not paste.is_alive: paste.delete() raise ValueError()