Output change
Some checks are pending
gl/check check status: pending (a3a3c5cd1fca2a8fe12a066f0dbfe5838f731bca)
Some checks are pending
gl/check check status: pending (a3a3c5cd1fca2a8fe12a066f0dbfe5838f731bca)
This commit is contained in:
parent
d21e492e1b
commit
a3a3c5cd1f
@ -115,12 +115,12 @@ class Services(object):
|
||||
|
||||
def service_types_with_doc_types(self, environment=None):
|
||||
"""Retrieve type and title from services and corresponding docs.
|
||||
As well as a list of all doc_types.
|
||||
As well as a list of all available doc types with title.
|
||||
|
||||
:param str environment: Optional service environment.
|
||||
"""
|
||||
service_list = []
|
||||
doc_types = []
|
||||
docs = []
|
||||
|
||||
for service in self.all_services:
|
||||
if not service["service_title"]:
|
||||
@ -139,8 +139,13 @@ class Services(object):
|
||||
"type": doc["type"]
|
||||
})
|
||||
|
||||
if doc["type"] not in doc_types:
|
||||
doc_types.append(doc["type"])
|
||||
new_doc = {
|
||||
"type": doc["type"],
|
||||
"title": doc["title"]
|
||||
}
|
||||
type_exists = any(doc_dict["type"] == new_doc["type"] for doc_dict in docs)
|
||||
if not type_exists:
|
||||
docs.append(new_doc)
|
||||
|
||||
service_list.append({
|
||||
"service_title": service["service_title"],
|
||||
@ -150,7 +155,7 @@ class Services(object):
|
||||
|
||||
res = {
|
||||
"services": service_list,
|
||||
"doc_types": doc_types
|
||||
"docs": docs
|
||||
}
|
||||
|
||||
return res
|
||||
|
Loading…
x
Reference in New Issue
Block a user