Skip to content

Commit

Permalink
Avoid unexpected error in test mode
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Aug 6, 2024
1 parent 65d8d07 commit 4e3ee20
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions github_app_geo_project/views/home.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,13 @@ def output(request: pyramid.request.Request) -> dict[str, Any]:

if admin:
try:
github = (
configuration.get_github_application(request.registry.settings, app) if admin else None
)

if "TEST_APPLICATION" not in os.environ:
github = (
configuration.get_github_application(request.registry.settings, app)
if admin
else None
)

github_events = set(github.integration.get_app().events)
# test that all events are in github_events
if not events.issubset(github_events):
Expand Down

0 comments on commit 4e3ee20

Please sign in to comment.