Skip to content

Commit

Permalink
Merge 2924190 into 11fb8de
Browse files Browse the repository at this point in the history
  • Loading branch information
bdmbdsm committed Nov 20, 2018
2 parents 11fb8de + 2924190 commit ae3ac88
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion openregistry/assets/basic/models.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from schematics.types import StringType
from schematics.types import StringType, ValidationError
from schematics.types.compound import ModelType, ListType
from zope.interface import implementer

Expand All @@ -18,3 +18,7 @@ class Asset(BaseAsset):
_internal_type = 'basic'
assetType = StringType(default="basic")
additionalClassifications = ListType(ModelType(AssetAdditionalClassification), default=list())

def validate_relatedLot(self, data, lot):
if data['status'] == 'active' and not lot:
raise ValidationError(u'This field is required.')

0 comments on commit ae3ac88

Please sign in to comment.