From 4f237d15b077da08b9ab1b8b174a4b37381f6cb4 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 7 Jun 2023 09:19:48 +0200 Subject: [PATCH] [FIX] runbot_merge: correctly check request in handle_pr 652b1ff9aea395b2bc24004e0e0741631190ba26 wanted to check if a request was available, however it deref'd the `request` object without checking it which is not correct: a `request` normally has an `httprequest`, but the `request` itself might be missing if the handler is called from e.g. a cron. Fixes #739 --- runbot_merge/controllers/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runbot_merge/controllers/__init__.py b/runbot_merge/controllers/__init__.py index 87b84606..efb752ac 100644 --- a/runbot_merge/controllers/__init__.py +++ b/runbot_merge/controllers/__init__.py @@ -154,7 +154,7 @@ def handle_pr(env, event): if not branch: return "Not set up to care about {}:{}".format(r, b) - headers = request.httprequest.headers if request.httprequest else {} + headers = request.httprequest.headers if request else {} _logger.info( "%s: %s#%s (%s) (by %s, delivery %s by %s)", event['action'],