Commit f8f980c
authored
fix(data): dynamically add empty validation status dict DEV-1159
### 📣 Summary
Fix error when loading data tables for submissions created before
validation_statuses were added.
### 💭 Notes
Backport of #6388
Set `_validation_status` to `{}` if it's None on the Instance (which may
happen if instances are bulk updated or created) when saving to mongo,
and, on the other side, set `_validation_status` to `{}` when returning
mongo results if it would otherwise be empty.
### 👀 Preview steps
1. ℹ️ have an account and a project
2. Add submissions to the project
3. In a mongo shell, run `db.instances.updateMany({"_userform_id":
"<username>_<asset_uid>"}, {$unset: {"_validation_status":""}})` . This
will mimic old instances where `_validation_status` isn't present
4. Go to the data table for the project
5. 🔴 [on main] Error
6. 🟢 [on PR] Data table loads successfully1 parent 16f52c0 commit f8f980c
File tree
4 files changed
+12
-6
lines changed- kobo/apps/openrosa/apps
- logger/models
- viewer/models
- kpi
- deployment_backends
- tests/api/v2
4 files changed
+12
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
368 | 368 | | |
369 | 369 | | |
370 | 370 | | |
371 | | - | |
| 371 | + | |
372 | 372 | | |
373 | 373 | | |
374 | 374 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
823 | 823 | | |
824 | 824 | | |
825 | 825 | | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
826 | 829 | | |
827 | 830 | | |
828 | 831 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1160 | 1160 | | |
1161 | 1161 | | |
1162 | 1162 | | |
1163 | | - | |
| 1163 | + | |
1164 | 1164 | | |
1165 | | - | |
1166 | | - | |
| 1165 | + | |
| 1166 | + | |
1167 | 1167 | | |
1168 | 1168 | | |
1169 | 1169 | | |
| |||
1172 | 1172 | | |
1173 | 1173 | | |
1174 | 1174 | | |
1175 | | - | |
| 1175 | + | |
| 1176 | + | |
1176 | 1177 | | |
1177 | 1178 | | |
1178 | 1179 | | |
| |||
1185 | 1186 | | |
1186 | 1187 | | |
1187 | 1188 | | |
| 1189 | + | |
1188 | 1190 | | |
| 1191 | + | |
1189 | 1192 | | |
1190 | 1193 | | |
1191 | 1194 | | |
| |||
0 commit comments