Skip to content

Commit

Permalink
Fix irm enabled organization sync setting (#5174)
Browse files Browse the repository at this point in the history
Check the right settings when enabling/disabling the irm plugin.
  • Loading branch information
matiasb authored Oct 14, 2024
1 parent 0672d06 commit 10b532c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion engine/apps/user_management/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def _sync_organization(organization: Organization) -> None:

# get IRM plugin settings
is_grafana_irm_enabled = False
grafana_irm_plugin_settings, _ = grafana_api_client.get_grafana_labels_plugin_settings()
grafana_irm_plugin_settings, _ = grafana_api_client.get_grafana_irm_plugin_settings()
if grafana_irm_plugin_settings is not None:
is_grafana_irm_enabled = grafana_irm_plugin_settings["enabled"]

Expand Down
4 changes: 4 additions & 0 deletions engine/apps/user_management/tests/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ def patched_grafana_api_client(organization, is_rbac_enabled_for_organization=(F
],
None,
)
mock_client_instance.get_grafana_irm_plugin_settings.return_value = (
{"enabled": False, "jsonData": {}},
None,
)
mock_client_instance.get_grafana_incident_plugin_settings.return_value = (
{"enabled": True, "jsonData": {GRAFANA_INCIDENT_PLUGIN_BACKEND_URL_KEY: MOCK_GRAFANA_INCIDENT_BACKEND_URL}},
None,
Expand Down

0 comments on commit 10b532c

Please sign in to comment.