Commit 7953e24
authored
[Affiliations] Hide bad data and add metadata validation (#13131)
## Summary of the problem
<!-- Why are these changes being made? What problem does it solve? Link
any related issues to provide more details. -->
https://appsignal.com/hack-club/sites/6596247683eb67648f30f807/exceptions/incidents/2761
Our frontend validations seem to have been bypassed, and affiliations
with metadata `{}` were created.
## Describe your changes
<!-- Explain your thought process to the solution and provide a quick
summary of the changes. -->
- Adds a `nonempty` scope to `Event::Affiliation` to hide any existing
affiliations with empty metadata
- Adds a `metadata_contains_required_fields` validation to ensure that
all affiliation types have backend validations that match their frontend
validations
<!-- If there are any visual changes, please attach images, videos, or
gifs. -->1 parent 48554c9 commit 7953e24
File tree
3 files changed
+25
-2
lines changed- app
- models/event
- views
- events/settings
- event/applications
3 files changed
+25
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
30 | 33 | | |
31 | 34 | | |
32 | 35 | | |
| |||
59 | 62 | | |
60 | 63 | | |
61 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
62 | 85 | | |
63 | 86 | | |
64 | 87 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
| 146 | + | |
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
0 commit comments