Commit 0b6adc82 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_cloud: if computer_guid is set, ignore project_guid

Prioritize computer_guid for now while parent_reference is used.
parent 660cd8ec
...@@ -34,12 +34,13 @@ if 'project_guid' in filter_kw: ...@@ -34,12 +34,13 @@ if 'project_guid' in filter_kw:
# direct query. # direct query.
project_reference = filter_kw.pop("project_guid") project_reference = filter_kw.pop("project_guid")
# Get Computer list from Tracking API if 'parent_reference' not in query_kw:
from DateTime import DateTime # Get Computer list from Tracking API
project = context.portal_catalog.getResultValue(portal_type="Project", reference=project_reference) from DateTime import DateTime
project = context.portal_catalog.getResultValue(portal_type="Project", reference=project_reference)
if project is not None: if project is not None:
query_kw["parent_reference"] = SimpleQuery(parent_reference=project.Project_getComputerReferenceList()) query_kw["parent_reference"] = SimpleQuery(parent_reference=project.Project_getComputerReferenceList())
if computer_network_query: if computer_network_query:
if query_kw.get("default_subordination_reference"): if query_kw.get("default_subordination_reference"):
......
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