Skip to content

Commit

Permalink
Disabled validation for enum
Browse files Browse the repository at this point in the history
From the admin, value passed in is always a string. This validation is
needless as the conversion from string works fine.
  • Loading branch information
reinoudvansanten committed Oct 4, 2013
1 parent 27c2121 commit d321d4f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions eav/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,12 @@ def validate_enum(value):
Raises ``ValidationError`` unless *value* is a saved
:class:`~eav.models.EnumValue` model instance.
'''
pass
"""
# This never passes, value is a str
from .models import EnumValue
if not isinstance(value, EnumValue):
raise ValidationError(_(u"Must be an EnumValue model object instance"))
if not value.pk:
raise ValidationError(_(u"EnumValue has not been saved yet"))
"""

0 comments on commit d321d4f

Please sign in to comment.