Disallow creation of product version with empty version name.

A product version with version name equals to null/empty/blank is
implicitly created with the product.  This patch disallows users
to create versions with empty name.

Change-Id: Iad477e486e23415ce20a9cd9367b9ef1a97173a4
This commit is contained in:
Catherine Diep 2016-11-22 16:24:01 -08:00
parent 6c2ae3ca83
commit 3699aa5101

View File

@ -250,3 +250,6 @@ class ProductVersionValidator(BaseValidator):
def validate(self, request):
"""Validate product version data."""
super(ProductVersionValidator, self).validate(request)
body = json.loads(request.body)
self.check_emptyness(body, ['version'])