Browse Source

fix(crons): Allow empty values on non-required fields (#43001)

Fixes https://github.com/getsentry/sentry/issues/42998

Should allow None on these fields or else users who create a cron
monitor can't edit it without filling in these values.
David Wang 2 years ago
parent
commit
7b7a0e2ee8
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/sentry/api/validators/monitor.py

+ 2 - 2
src/sentry/api/validators/monitor.py

@@ -44,8 +44,8 @@ class CronJobValidator(serializers.Serializer):
         choices=list(zip(SCHEDULE_TYPES.keys(), SCHEDULE_TYPES.keys()))
     )
     schedule = ObjectField()
-    checkin_margin = EmptyIntegerField(required=False, default=None)
-    max_runtime = EmptyIntegerField(required=False, default=None)
+    checkin_margin = EmptyIntegerField(required=False, allow_null=True, default=None)
+    max_runtime = EmptyIntegerField(required=False, allow_null=True, default=None)
 
     def validate_schedule_type(self, value):
         if value: