Comparing version 0.1.13-alpha.2 to 0.1.13-alpha.5
@@ -9,7 +9,12 @@ const { ValueError } = require('../errors') | ||
parse (value) { | ||
if (this.choices && !this.choices.includes(value)) { | ||
validateValue (inst, fieldName) { | ||
const value = inst.get(fieldName) | ||
if ( | ||
typeof value !== 'undefined' && | ||
this.choices && | ||
!this.choices.includes(value) | ||
) { | ||
throw new ValueError(`Invalid choice "${value}"`) | ||
} | ||
return value | ||
return super.validateValue(inst, fieldName) | ||
} | ||
@@ -16,0 +21,0 @@ } |
{ | ||
"name": "djorm", | ||
"version": "0.1.13-alpha.2", | ||
"version": "0.1.13-alpha.5", | ||
"description": "Django like ORM framework", | ||
@@ -39,3 +39,3 @@ "author": "Pavel Žák <pavel@zak.global>", | ||
}, | ||
"gitHead": "cf6b2e83ef0abcc6543c50849658e15fec0b2aa0" | ||
"gitHead": "c88e59efda9c8ccd5a99e2c056f71432cbb33720" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
76363
2681