From a76b1ca66d776fbe4566d7f23b38b087ae32530b Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 20 Jun 2023 15:00:29 +0200 Subject: [PATCH] fix(exports): properly handle export format not being handled Signed-off-by: Thomas Citharel --- .sobelow-skips | 3 ++- lib/web/controllers/export_controller.ex | 11 +++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.sobelow-skips b/.sobelow-skips index 9604b081..c75fab5e 100644 --- a/.sobelow-skips +++ b/.sobelow-skips @@ -41,4 +41,5 @@ FE1EEB91EA633570F703B251AE2D4D4E E7967805C1EA5301F2722C7BDB2F25F3 BDFB0FB1AAF69C18212CBCFD42F8B717 40220A533CCACB3A1CE9DBF1A8A430A1 -EEB29D1DDA3A3015BC645A989B5BD38E \ No newline at end of file +EEB29D1DDA3A3015BC645A989B5BD38E +5AEE3C678C80E0389C3B0D9D11886EB6 \ No newline at end of file diff --git a/lib/web/controllers/export_controller.ex b/lib/web/controllers/export_controller.ex index ce937b68..dd660e2f 100644 --- a/lib/web/controllers/export_controller.ex +++ b/lib/web/controllers/export_controller.ex @@ -26,10 +26,13 @@ defmodule Mobilizon.Web.ExportController do {:error, :not_found} end else - {:error, - dgettext("errors", "Export to format %{format} is not enabled on this instance", - format: format - )} + send_resp( + conn, + 404, + dgettext("errors", "Export to format %{format} is not enabled on this instance", + format: format + ) + ) end end end