From 8087c2b2783eda521a152bc439b08e8b163cf4e8 Mon Sep 17 00:00:00 2001 From: Alexander Metzger Date: Mon, 24 Jun 2024 02:54:54 -0700 Subject: [PATCH] better error message for edge case --- routers/facebook_api.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/routers/facebook_api.py b/routers/facebook_api.py index 7a34c484f..ab760b053 100644 --- a/routers/facebook_api.py +++ b/routers/facebook_api.py @@ -141,6 +141,11 @@ def fb_connect_redirect(request: Request): retry_button = ( f'Retry' ) + if not current_run_id or not published_run_id: + return HTMLResponse( + f"

Oh No! Something went wrong here. Please go back to the integration page and try again or contact support.

", + status_code=400, + ) current_run = SavedRun.objects.get(run_id=current_run_id) published_run = PublishedRun.objects.filter( published_run_id=published_run_id