From 7397e808a8edd31e6eb556d8c0e7d9696859938d Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Mon, 18 Jun 2018 12:52:12 +0100 Subject: [PATCH] Make expected behaviour clear in `else` case It feels a bit slippery having an `if`/`elif` with no else; I think that adding this comment makes the code clearer. --- app/main/views/api_keys.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/main/views/api_keys.py b/app/main/views/api_keys.py index 28293c8fc..9cd060522 100644 --- a/app/main/views/api_keys.py +++ b/app/main/views/api_keys.py @@ -232,6 +232,12 @@ def delivery_status_callback(service_id): bearer_token=form.bearer_token.data, user_id=current_user.id ) + else: + # If no callback is set up and the user chooses to continue + # having no callback (ie both fields empty) then there’s + # nothing for us to do here + pass + return redirect(url_for(back_link, service_id=service_id)) return render_template(