1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-05 05:51:21 +03:00

AC-435. Fix JS error for making LDAP-managed fields readonly.

This commit is contained in:
Chris Church 2013-09-10 13:58:52 -04:00
parent 75aeb0cb84
commit 505b2b9998

View File

@ -375,11 +375,14 @@ function UsersEdit ($scope, $rootScope, $compile, $location, $log, $routeParams,
Rest.get() Rest.get()
.success( function(data, status, headers, config) { .success( function(data, status, headers, config) {
if (data['user_ldap_fields']) { if (data['user_ldap_fields']) {
for (var fld in data['user_ldap_fields']) { for (var i in data['user_ldap_fields']) {
form.fields[fld]['readonly'] = true; var fld = data['user_ldap_fields'][i];
form.fields[fld]['editRequired'] = false; if (form.fields[fld]) {
if (form.fields[fld].awRequiredWhen) { form.fields[fld]['readonly'] = true;
delete form.fields[fld].awRequiredWhen; form.fields[fld]['editRequired'] = false;
if (form.fields[fld].awRequiredWhen) {
delete form.fields[fld].awRequiredWhen;
}
} }
} }
} }