1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-09-08 05:58:43 +02:00

Fix XmlModel to load an empty string in an int field as None

This commit is contained in:
2024-04-17 10:33:08 +02:00
parent dc7efaa6de
commit eb2678e0c7
2 changed files with 34 additions and 0 deletions

View File

@@ -594,6 +594,8 @@ class XmlModel(BaseModel):
return value
if field.origin_type is int:
if not value or not value.strip():
return None
value = int(value)
return value