MCPcopy Create free account
hub / github.com/WebODM/WebODM / get

Method get

app/api/processingnodes.py:66–95  ·  view source on GitHub ↗
(self, request)

Source from the content-addressed store, hash-verified

64 queryset = ProcessingNode.objects.all()
65
66 def get(self, request):
67
68 nodes = get_objects_for_user(request.user, 'view_processingnode', ProcessingNode, accept_global_perms=False)
69 common_options = []
70
71 for node in nodes:
72 # Skip offline nodes
73 if not node.is_online():
74 continue
75
76 # First? Just populate
77 if len(common_options) == 0 and len(node.available_options) > 0:
78 common_options = node.available_options
79 else:
80 # Remove all options that are in common_options,
81 # but that are not in node.available_options
82 for common_option in common_options:
83 found = False
84 for option in node.available_options:
85 if common_option['name'] == option['name']:
86 found = True
87 break
88
89 # Mark for deletion
90 if not found:
91 common_option['_delete'] = True
92
93 common_options = [co for co in common_options if not '_delete' in co]
94
95 return Response(common_options)

Callers

nothing calls this directly

Calls 1

is_onlineMethod · 0.80

Tested by

no test coverage detected