Commit aff01be
authored
fix(monitors): Allow editing cron monitor detectors with existing slug (#103846)
Fixed [NEW-648: Cron detectors can't be edited due to
error](https://linear.app/getsentry/issue/NEW-648/cron-detectors-cant-be-edited-due-to-error)
When updating a cron monitor detector with dataSources in the request
body,
the slug validation was incorrectly rejecting the existing slug as
"already
in use". This occurred because the MonitorDataSourceValidator nested in
a
ListField didn't have its instance property set during validation.
Created MonitorDataSourceListField to bind the Monitor instance to child
validators before validation runs, allowing the slug check to recognize
updates vs creates.1 parent 4b341f6 commit aff01be
File tree
2 files changed
+59
-1
lines changed- src/sentry/monitors
- tests/sentry/monitors/endpoints
2 files changed
+59
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
686 | 686 | | |
687 | 687 | | |
688 | 688 | | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
689 | 711 | | |
690 | 712 | | |
691 | 713 | | |
| |||
694 | 716 | | |
695 | 717 | | |
696 | 718 | | |
697 | | - | |
| 719 | + | |
698 | 720 | | |
699 | 721 | | |
700 | 722 | | |
| |||
Lines changed: 36 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
141 | 177 | | |
142 | 178 | | |
143 | 179 | | |
| |||
0 commit comments