Commit 9547d509 authored by Alain Takoudjou's avatar Alain Takoudjou Committed by Rafael Monnerat

[erp5_web_monitoring] do not sync opml from stopped hosting subscription

parent 63383559
......@@ -297,7 +297,7 @@
}
return gadget.state.erp5_gadget.allDocs({
query: '(portal_type:"Hosting Subscription") AND (validation_state:"validated")',
select_list: ['title', 'default_predecessor_uid', 'uid'],
select_list: ['title', 'default_predecessor_uid', 'uid', 'slap_state'],
limit: [0, limit],
sort_on: [
["creation_date", "descending"]
......@@ -307,13 +307,17 @@
var i,
uid_search_list = [];
for (i = 0; i < result.data.total_rows; i += 1) {
hosting_subscription_list.push({
title: result.data.rows[i].value.title,
relative_url: result.data.rows[i].id
});
uid_search_list.push(result.data.rows[i].value.uid);
if (result.data.rows[i].value.default_predecessor_uid) {
uid_dict[result.data.rows[i].value.default_predecessor_uid] = i;
if (result.data.rows[i].value.slap_state !== "destroy_requested") {
hosting_subscription_list.push({
title: result.data.rows[i].value.title,
relative_url: result.data.rows[i].id,
active: (result.data.rows[i].value.slap_state ===
"start_requested") ? true : false
});
uid_search_list.push(result.data.rows[i].value.uid);
if (result.data.rows[i].value.default_predecessor_uid) {
uid_dict[result.data.rows[i].value.default_predecessor_uid] = i;
}
}
}
return gadget.state.erp5_gadget.allDocs({
......@@ -344,7 +348,7 @@
password: tmp_parameter.password,
basic_login: btoa(tmp_parameter.username + ':' +
tmp_parameter.password),
active: true
active: hosting_subscription_list[uid_dict[tmp_uid]].active
});
}
}
......
......@@ -250,7 +250,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.37770.32649.6058</string> </value>
<value> <string>964.27271.46031.23108</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -268,7 +268,7 @@
</tuple>
<state>
<tuple>
<float>1511174176.26</float>
<float>1514389684.37</float>
<string>UTC</string>
</tuple>
</state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment