|
41 | 41 | from sentry.api.authentication import AuthenticationSiloLimit, StandardAuthentication
|
42 | 42 | from sentry.api.base import Endpoint, region_silo_endpoint
|
43 | 43 | from sentry.api.endpoints.organization_trace_item_attributes import as_attribute_key
|
44 |
| -from sentry.constants import ENABLE_PR_REVIEW_TEST_GENERATION_DEFAULT, ObjectStatus |
| 44 | +from sentry.constants import ( |
| 45 | + ENABLE_PR_REVIEW_TEST_GENERATION_DEFAULT, |
| 46 | + HIDE_AI_FEATURES_DEFAULT, |
| 47 | + ObjectStatus, |
| 48 | +) |
45 | 49 | from sentry.exceptions import InvalidSearchQuery
|
46 | 50 | from sentry.hybridcloud.rpc.service import RpcAuthenticationSetupException, RpcResolutionException
|
47 | 51 | from sentry.hybridcloud.rpc.sig import SerializableFunctionValueException
|
@@ -229,18 +233,16 @@ def get_organization_seer_consent_by_org_name(
|
229 | 233 | for org_integration in org_integrations:
|
230 | 234 | try:
|
231 | 235 | org = Organization.objects.get(id=org_integration.organization_id)
|
232 |
| - seer_org_acknowledgement = get_seer_org_acknowledgement(org_id=org.id) |
233 |
| - github_extension_enabled = org.id in options.get("github-extension.enabled-orgs") |
| 236 | + |
| 237 | + hide_ai_features = org.get_option("sentry:hide_ai_features", HIDE_AI_FEATURES_DEFAULT) |
234 | 238 | pr_review_test_generation_enabled = bool(
|
235 | 239 | org.get_option(
|
236 | 240 | "sentry:enable_pr_review_test_generation",
|
237 | 241 | ENABLE_PR_REVIEW_TEST_GENERATION_DEFAULT,
|
238 | 242 | )
|
239 | 243 | )
|
240 | 244 |
|
241 |
| - if ( |
242 |
| - seer_org_acknowledgement or github_extension_enabled |
243 |
| - ) and pr_review_test_generation_enabled: |
| 245 | + if not hide_ai_features and pr_review_test_generation_enabled: |
244 | 246 | return {"consent": True}
|
245 | 247 | except Organization.DoesNotExist:
|
246 | 248 | continue
|
|
0 commit comments