Skip to content

Commit

Permalink
validation of invalid or none value
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Oct 29, 2015
1 parent 736f9ce commit 10e5489
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/quorum/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ def __str__(self):
default = cls.default()
if not default: return cls._name()
value = self.model[default]
if value == None: value = ""
is_string = legacy.is_str(value)
return value if is_string else str(value)

Expand All @@ -237,6 +238,7 @@ def __unicode__(self):
default = cls.default()
if not default: return cls._name()
value = self.model[default]
if value == None: value = ""
is_unicode = legacy.is_unicode(value)
return value if is_unicode else legacy.UNICODE(value)

Expand Down

0 comments on commit 10e5489

Please sign in to comment.