[FIX] runbot_merge: correctly check request in handle_pr

652b1ff9ae 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
This commit is contained in:
Xavier Morel 2023-06-07 09:19:48 +02:00
parent a80dc25699
commit 4f237d15b0

View File

@ -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'],