mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-23 15:40:01 -06:00
Fix Update function on details page.
The problem was that parameters with no values are automatically set to None by the framework and it wasn't handled properly in baseldap.py:get_attributes function. Also, there were two logical bugs in details.js: 1) atttribute callback to update values were called for input elements instead of dt elements 2) it was always trying to update the primary key
This commit is contained in:
parent
19466d499b
commit
7a007d958b
@ -92,17 +92,9 @@ function ipa_details_update(pkey, on_win, on_fail)
|
||||
return;
|
||||
|
||||
var attr = dt.attr('title');
|
||||
if (!attr)
|
||||
if (!attr || attr.indexOf('call_') == 0)
|
||||
return;
|
||||
|
||||
if (attr.indexOf('call_') == 0) {
|
||||
var func = window[attr.substr(5)];
|
||||
if (!func)
|
||||
return;
|
||||
func(dt, modlist, IPA_DETAILS_UPDATE);
|
||||
return;
|
||||
}
|
||||
|
||||
var param_info = ipa_get_param_info(attr);
|
||||
if (param_info) {
|
||||
modlist[attr] = jobj.val();
|
||||
@ -118,7 +110,18 @@ function ipa_details_update(pkey, on_win, on_fail)
|
||||
var jobj = $(this);
|
||||
|
||||
var attr = jobj.attr('title');
|
||||
if (!attr || attr.indexOf('call_') == 0)
|
||||
if (!attr)
|
||||
return;
|
||||
|
||||
if (attr.indexOf('call_') == 0) {
|
||||
var func = window[attr.substr(5)];
|
||||
if (func)
|
||||
func(jobj, modlist, IPA_DETAILS_UPDATE);
|
||||
return;
|
||||
}
|
||||
|
||||
var param_info = ipa_get_param_info(attr);
|
||||
if (param_info && param_info['primary_key'])
|
||||
return;
|
||||
|
||||
var next = jobj.next('dd');
|
||||
|
@ -49,10 +49,10 @@ def get_attributes(attrs):
|
||||
Given a list of values in the form name=value, return a list of name.
|
||||
"""
|
||||
attrlist=[]
|
||||
if attrs:
|
||||
for attr in attrs:
|
||||
m = re.match("\s*(.*?)\s*=\s*(.*?)\s*$", attr)
|
||||
attrlist.append(str(m.group(1)).lower())
|
||||
|
||||
return attrlist
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user