Merge pull request #430 from ryanpetrello/fix-7620

don't show polymorphic_ctype in unique validation error messaging
This commit is contained in:
Ryan Petrello 2017-09-20 12:41:41 -04:00 committed by Matthew Jones
commit 91ec0a4482

View File

@ -309,7 +309,10 @@ class PrimordialModel(CreatedModifiedModel):
continue
if not (self.pk and self.pk == obj.pk):
errors.append(
'%s with this (%s) combination already exists.' % (model.__name__, ', '.join(ut))
'%s with this (%s) combination already exists.' % (
model.__name__,
', '.join(set(ut) - {'polymorphic_ctype'})
)
)
if errors:
raise ValidationError(errors)