File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 1
- __version__ = "1.21 "
1
+ __version__ = "1.22 "
Original file line number Diff line number Diff line change @@ -63,12 +63,14 @@ def validate(self, attrs):
63
63
invalid_targets = "," .join (targets_dict ["invalid_targets" ])
64
64
raise serializers .ValidationError (f"Invalid excluded targets provided: { invalid_targets } " )
65
65
66
- # Email scan alerts and email addresses.
67
- email_scan_alerts = attrs ["email_scan_alerts" ]
68
- email_alert_address = attrs ["email_alert_address" ]
66
+ # Email scan alerts and email address.
67
+ if ("email_scan_alerts" in attrs ) and ("email_alert_address" in attrs ):
69
68
70
- if email_scan_alerts and not email_alert_address :
71
- raise serializers .ValidationError (f"Provide an email address if enabling 'Email scan alerts'" )
69
+ email_scan_alerts = attrs ["email_scan_alerts" ]
70
+ email_alert_address = attrs ["email_alert_address" ]
71
+
72
+ if email_scan_alerts and not email_alert_address :
73
+ raise serializers .ValidationError (f"Provide an email address if enabling 'Email scan alerts'" )
72
74
73
75
return attrs
74
76
You can’t perform that action at this time.
0 commit comments