Skip to content

Commit

Permalink
doesn't validate from model admin (my main current usage)
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve Ivy committed Apr 29, 2011
1 parent 17a0bf4 commit cf11cdc
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions eav/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,9 @@ def validate_enum(value):
Raises ``ValidationError`` unless *value* is a saved
:class:`~eav.models.EnumValue` model instance.
'''
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"))
#### DOESN'T WORK IN THE MODEL ADMIN
# 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"))

1 comment on commit cf11cdc

@ksamuel
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Django-eav is not maintained anymore, please fork.

Please sign in to comment.