diff --git a/shared/torngit/base.py b/shared/torngit/base.py index d6e1dc0d..a45cd981 100644 --- a/shared/torngit/base.py +++ b/shared/torngit/base.py @@ -1,5 +1,5 @@ import re -from enum import Enum, auto +from enum import Enum from typing import Dict, List, Optional, Tuple import httpx diff --git a/shared/torngit/github.py b/shared/torngit/github.py index 595372f0..678baaeb 100644 --- a/shared/torngit/github.py +++ b/shared/torngit/github.py @@ -739,6 +739,7 @@ def _get_next_fallback_token( installation_info = fallback_installations.pop(0) # The function arg is 'integration_id' installation_id = installation_info.pop("installation_id") + obj_id = installation_info.pop("id", None) token_to_use = get_github_integration_token( self.service, installation_id, **installation_info ) @@ -747,6 +748,7 @@ def _get_next_fallback_token( self.data["installation"] = { # Put the installation_id back into the info "installation_id": installation_id, + "id": obj_id, **installation_info, } return token_to_use diff --git a/tests/unit/torngit/test_github.py b/tests/unit/torngit/test_github.py index 169cc791..8f944d88 100644 --- a/tests/unit/torngit/test_github.py +++ b/tests/unit/torngit/test_github.py @@ -1097,7 +1097,12 @@ async def test_update_check_run_url_fallback(self, mocker): installation_id=1500, ), fallback_installations=[ - {"installation_id": 12342, "app_id": 1200, "pem_path": "some_path"} + { + "installation_id": 12342, + "app_id": 1200, + "pem_path": "some_path", + "id": 20, + } ], )