From 96572fe3d4c4f130a5be2b771f201836ac94876e Mon Sep 17 00:00:00 2001 From: Ryan Petrello Date: Tue, 19 Sep 2017 15:58:43 -0400 Subject: [PATCH] don't show polymorphic_ctype in unique validation error messaging see: https://github.com/ansible/ansible-tower/issues/7620 --- awx/main/models/base.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/awx/main/models/base.py b/awx/main/models/base.py index 6c038dad74..ebfe0bf1c5 100644 --- a/awx/main/models/base.py +++ b/awx/main/models/base.py @@ -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)