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

View File

@@ -309,7 +309,10 @@ class PrimordialModel(CreatedModifiedModel):
continue continue
if not (self.pk and self.pk == obj.pk): if not (self.pk and self.pk == obj.pk):
errors.append( 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: if errors:
raise ValidationError(errors) raise ValidationError(errors)