From 9458741b72c1b18a1a0506dcb1893b9f5a12a240 Mon Sep 17 00:00:00 2001 From: Ryan Petrello Date: Sat, 16 Nov 2019 16:55:39 -0500 Subject: [PATCH] don't set rh_username and rh_password in the license upload --- .../migrations/0099_v361_license_cleanup.py | 21 +++++++++++++++++++ .../client/src/license/license.controller.js | 4 ---- 2 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 awx/main/migrations/0099_v361_license_cleanup.py diff --git a/awx/main/migrations/0099_v361_license_cleanup.py b/awx/main/migrations/0099_v361_license_cleanup.py new file mode 100644 index 0000000000..f3e1b4e6ed --- /dev/null +++ b/awx/main/migrations/0099_v361_license_cleanup.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations + + +def _cleanup_license_setting(apps, schema_editor): + Setting = apps.get_model('conf', 'Setting') + for license in Setting.objects.filter(key='LICENSE').all(): + for k in ('rh_username', 'rh_password'): + license.value.pop(k, None) + license.save() + + +class Migration(migrations.Migration): + + dependencies = [ + ('main', '0098_v360_rename_cyberark_aim_credential_type'), + ] + + operations = [migrations.RunPython(_cleanup_license_setting)] diff --git a/awx/ui/client/src/license/license.controller.js b/awx/ui/client/src/license/license.controller.js index c085076fc7..9e344dd2e4 100644 --- a/awx/ui/client/src/license/license.controller.js +++ b/awx/ui/client/src/license/license.controller.js @@ -187,10 +187,6 @@ export default payload = $scope.newLicense.file; } else if ($scope.selectedLicense.fullLicense) { payload = $scope.selectedLicense.fullLicense; - if ($scope.rhCreds.username && $scope.rhCreds.password) { - payload.rh_password = $scope.rhCreds.password; - payload.rh_username = $scope.rhCreds.username; - } } CheckLicense.post(payload, $scope.newLicense.eula)