From 538b1cbb581f35cd7fe5aab284b194caf9cb1ef4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sn=C3=ADda=C5=88ov=C3=BD=20Mistr?= Date: Mon, 4 Mar 2024 20:28:44 +0100 Subject: [PATCH] =?UTF-8?q?Hovno=20hovno=20bany=20nebo=20n=C4=9Bco?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/db/post.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/db/post.rs b/src/db/post.rs index 49bf0a9..3116d2a 100755 --- a/src/db/post.rs +++ b/src/db/post.rs @@ -333,9 +333,11 @@ impl Post { .bind(content) .bind(&content_nomarkup) .bind(self.id) - .fetch_one(ctx.db()) + .fetch_optional(ctx.db()) .await?; + let Some(post) = post else { return Ok(()) }; + let old_key = format!( "by_content:{}", digest(self.content_nomarkup.to_lowercase())