1
0
mirror of https://github.com/rancher/norman.git synced 2025-09-01 23:36:58 +00:00

don't return nonnullable error if default is set

This commit is contained in:
Daishan Peng
2018-01-17 16:49:33 -07:00
committed by Darren Shepherd
parent d4e7ad28b8
commit 409b391766

View File

@@ -162,7 +162,9 @@ func checkFieldCriteria(fieldName string, field types.Field, value interface{})
}
if (value == nil || value == "") && !field.Nullable {
return httperror.NewFieldAPIError(httperror.NotNullable, fieldName, "")
if field.Default == nil {
return httperror.NewFieldAPIError(httperror.NotNullable, fieldName, "")
}
}
if isNum {