Commit 2e17ab3
committed
Fix config import validation issues
This commit addresses two validation issues that prevented importing
configuration files exported from production:
1. Export serializer converting version numbers to floats:
- The _json_serializer in admin_supported_products.py was converting
all Decimal types to float, including version numbers
- Version numbers (match_major_version, match_minor_version) should
be integers, not floats
- Updated serializer to check if Decimal is a whole number and
convert to int, preserving proper type semantics
2. Name validation rejecting parentheses:
- Production database contains legacy products with names like
"Rocky Linux 8.5 x86_64 (Legacy)"
- Validation pattern only allowed: letters, numbers, spaces, dots,
hyphens, and underscores
- Updated NAME_PATTERN to allow parentheses for legacy product naming
- Updated error message to reflect allowed characters
These changes ensure that configurations exported from production can
be successfully imported into development environments without manual
data cleanup.1 parent c6c9983 commit 2e17ab3
File tree
2 files changed
+7
-3
lines changed- apollo/server
- routes
2 files changed
+7
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1296 | 1296 | | |
1297 | 1297 | | |
1298 | 1298 | | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
1299 | 1303 | | |
1300 | 1304 | | |
1301 | 1305 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
64 | | - | |
| 63 | + | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
| 110 | + | |
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| |||
0 commit comments