From f4e67f789f5a0dcbee94c06c777749a16582c9c7 Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Wed, 17 Dec 2014 12:59:52 -0500 Subject: [PATCH] More making sure we are using smart_str --- awx/api/serializers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/awx/api/serializers.py b/awx/api/serializers.py index 0b13415206..2fda2f6057 100644 --- a/awx/api/serializers.py +++ b/awx/api/serializers.py @@ -23,6 +23,7 @@ from django.core.exceptions import ObjectDoesNotExist from django.db.models.fields import BLANK_CHOICE_DASH from django.utils.datastructures import SortedDict from django.utils.translation import ugettext_lazy as _ +from django.utils.encoding import smart_str from django.core.cache import cache # Django REST Framework @@ -1315,7 +1316,7 @@ class JobOptionsSerializer(BaseSerializer): def validate_playbook(self, attrs, source): project = attrs.get('project', None) playbook = attrs.get('playbook', '') - if project and playbook and playbook not in project.playbooks: + if project and playbook and smart_str(playbook) not in project.playbooks: raise serializers.ValidationError('Playbook not found for project') return attrs