remove credential_type iteration, explicitly check for encyption with startswith

This commit is contained in:
Wayne Witzel III
2017-06-15 11:08:22 -04:00
parent 2c1a39233e
commit c554c10c5c

View File

@@ -32,8 +32,6 @@ def _credentials(apps):
utils.get_current_apps = lambda: apps utils.get_current_apps = lambda: apps
for credential in apps.get_model('main', 'Credential').objects.all(): for credential in apps.get_model('main', 'Credential').objects.all():
for field_name, value in credential.inputs.items(): for field_name, value in credential.inputs.items():
if field_name in credential.credential_type.inputs.get('fields', []):
value = getattr(credential, field_name)
if value.startswith('$encrypted$AESCBC$'): if value.startswith('$encrypted$AESCBC$'):
continue continue
elif value.startswith('$encrypted$AES$'): elif value.startswith('$encrypted$AES$'):