@@ -95,6 +95,33 @@ class ProjectMemberSerializer(serializers.Serializer):
95
95
help_text = "Enables starring the project within the projects tab. Can be updated with **`project:read`** permission." ,
96
96
required = False ,
97
97
)
98
+ autofixAutomationTuning = serializers .ChoiceField (
99
+ choices = [item .value for item in AutofixAutomationTuningSettings ],
100
+ required = False ,
101
+ )
102
+ seerScannerAutomation = serializers .BooleanField (required = False )
103
+
104
+ def validate_autofixAutomationTuning (self , value ):
105
+ organization = self .context ["project" ].organization
106
+ actor = self .context ["request" ].user
107
+ if not features .has (
108
+ "organizations:trigger-autofix-on-issue-summary" , organization , actor = actor
109
+ ):
110
+ raise serializers .ValidationError (
111
+ "Organization does not have the trigger-autofix-on-issue-summary feature enabled."
112
+ )
113
+ return value
114
+
115
+ def validate_seerScannerAutomation (self , value ):
116
+ organization = self .context ["project" ].organization
117
+ actor = self .context ["request" ].user
118
+ if not features .has (
119
+ "organizations:trigger-autofix-on-issue-summary" , organization , actor = actor
120
+ ):
121
+ raise serializers .ValidationError (
122
+ "Organization does not have the trigger-autofix-on-issue-summary feature enabled."
123
+ )
124
+ return value
98
125
99
126
100
127
@extend_schema_serializer (
@@ -222,10 +249,6 @@ class ProjectAdminSerializer(ProjectMemberSerializer):
222
249
dynamicSamplingBiases = DynamicSamplingBiasSerializer (required = False , many = True )
223
250
tempestFetchScreenshots = serializers .BooleanField (required = False )
224
251
tempestFetchDumps = serializers .BooleanField (required = False )
225
- autofixAutomationTuning = serializers .ChoiceField (
226
- choices = [item .value for item in AutofixAutomationTuningSettings ], required = False
227
- )
228
- seerScannerAutomation = serializers .BooleanField (required = False )
229
252
230
253
# DO NOT ADD MORE TO OPTIONS
231
254
# Each param should be a field in the serializer like above.
@@ -446,28 +469,6 @@ def validate_tempestFetchDumps(self, value):
446
469
)
447
470
return value
448
471
449
- def validate_autofixAutomationTuning (self , value ):
450
- organization = self .context ["project" ].organization
451
- actor = self .context ["request" ].user
452
- if not features .has (
453
- "organizations:trigger-autofix-on-issue-summary" , organization , actor = actor
454
- ):
455
- raise serializers .ValidationError (
456
- "Organization does not have the trigger-autofix-on-issue-summary feature enabled."
457
- )
458
- return value
459
-
460
- def validate_seerScannerAutomation (self , value ):
461
- organization = self .context ["project" ].organization
462
- actor = self .context ["request" ].user
463
- if not features .has (
464
- "organizations:trigger-autofix-on-issue-summary" , organization , actor = actor
465
- ):
466
- raise serializers .ValidationError (
467
- "Organization does not have the trigger-autofix-on-issue-summary feature enabled."
468
- )
469
- return value
470
-
471
472
472
473
class RelaxedProjectPermission (ProjectPermission ):
473
474
scope_map = {
@@ -566,7 +567,7 @@ def put(self, request: Request, project) -> Response:
566
567
Update various attributes and configurable settings for the given project.
567
568
568
569
Note that solely having the **`project:read`** scope restricts updatable settings to
569
- `isBookmarked`.
570
+ `isBookmarked`, `autofixAutomationTuning`, and `seerScannerAutomation` .
570
571
"""
571
572
if not request .user .is_authenticated :
572
573
return Response (status = status .HTTP_400_BAD_REQUEST )
0 commit comments