From 812378ea94cb99fd00f897c32dece02239210671 Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Tue, 20 Dec 2016 22:21:39 -0800 Subject: [PATCH] Fix blog posts losing data when previewing updates When editing an existing blog post, and clicking on "Preview" instead of just saving directly, the blog post would have its date/time updated to "now" instead of keeping its original time (and regardless of the checkbox to reset time not being checked). The fix was to catch the post ID from the submission so it can load the existing data first; previously it was only getting the post ID from the query string, which isn't used when previewing the post. --- rophako/modules/blog/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rophako/modules/blog/__init__.py b/rophako/modules/blog/__init__.py index f536b1d..1715932 100644 --- a/rophako/modules/blog/__init__.py +++ b/rophako/modules/blog/__init__.py @@ -199,7 +199,7 @@ def update(): )) # Editing an existing post? - post_id = request.args.get("id", None) + post_id = request.args.get("id", request.form.get("id", None)) if post_id: post_id = Blog.resolve_id(post_id, drafts=True) if post_id: