From 7111d9232f3913f5153ef799de5a804b2ce01692 Mon Sep 17 00:00:00 2001 From: Wayne Witzel III Date: Tue, 20 Jun 2017 10:37:44 -0400 Subject: [PATCH] Fix should_decrypt_field to work with non-str fields (return False) --- awx/conf/migrations/_reencrypt.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/awx/conf/migrations/_reencrypt.py b/awx/conf/migrations/_reencrypt.py index ca19a9234c..7e3fe893b1 100644 --- a/awx/conf/migrations/_reencrypt.py +++ b/awx/conf/migrations/_reencrypt.py @@ -102,4 +102,6 @@ def encrypt_field(instance, field_name, ask=False, subfield=None, skip_utf8=Fals def should_decrypt_field(value): - return value.startswith('$encrypted$') and '$AESCBC$' not in value + if hasattr(value, 'startswith'): + return value.startswith('$encrypted$') and '$AESCBC$' not in value + return False