Просмотр исходного кода

feat(api): Added `include_feature_flags` Query Param for Organization Details (#71438)

In this pr I introduce a new query param `include_feature_flags`, which
by default will be False. Eventually, api calls will have to pass
`include_feature_flags=1` in order to get all the features of the org.

There will be 2 follow-up prs, one to update the frontend to use this
query param, and one to actually implement the logic to using the query
param.

Additionally, the `DELETE` method will be updated so it never returns
flags.

For:
https://github.com/getsentry/team-core-product-foundations/issues/326
Raj Joshi 9 месяцев назад
Родитель
Сommit
57bd8d5742
1 измененных файлов с 8 добавлено и 0 удалено
  1. 8 0
      src/sentry/api/endpoints/organization_details.py

+ 8 - 0
src/sentry/api/endpoints/organization_details.py

@@ -576,6 +576,10 @@ class OrganizationDetailsEndpoint(OrganizationEndpoint):
         :param string detailed: Specify '0' to retrieve details without projects and teams.
         :auth: required
         """
+        # This param will be used to determine if we should include feature flags in the response
+        include_feature_flags = request.GET.get("include_feature_flags", "0") != "0"
+        (include_feature_flags)  # TODO: Remove this once include_feature_flags is used
+
         serializer = org_serializers.OrganizationSerializer
 
         if request.access.has_scope("org:read") or is_active_staff(request):
@@ -606,6 +610,10 @@ class OrganizationDetailsEndpoint(OrganizationEndpoint):
         """
         from sentry import features
 
+        # This param will be used to determine if we should include feature flags in the response
+        include_feature_flags = request.GET.get("include_feature_flags", "0") != "0"
+        (include_feature_flags)  # TODO: Remove this once include_feature_flags is used
+
         # We don't need to check for staff here b/c the _admin portal uses another endpoint to update orgs
         if request.access.has_scope("org:admin"):
             serializer_cls = OwnerOrganizationSerializer