def process_get(self): collections_db = self._db.query(Collection).order_by( Collection.name).all() ConfigurationSetting.cache_warm(self._db) Collection.cache_warm(self._db, lambda: collections_db) protocols = self._get_collection_protocols() user = flask.request.admin collections = [] protocolClass = None for collection_object in collections_db: if not user or not user.can_see_collection(collection_object): continue collection_dict = self.collection_to_dict(collection_object) if collection_object.protocol in [ p.get("name") for p in protocols ]: [protocol] = [ p for p in protocols if p.get("name") == collection_object.protocol ] libraries = self.load_libraries(collection_object, user, protocol) collection_dict["libraries"] = libraries settings = self.load_settings( protocol.get("settings"), collection_object, collection_dict.get("settings"), ) collection_dict["settings"] = settings protocolClass = self.find_protocol_class(collection_object) collection_dict[ "self_test_results"] = self._get_prior_test_results( collection_object, protocolClass) collection_dict[ "marked_for_deletion"] = collection_object.marked_for_deletion collections.append(collection_dict) return dict( collections=collections, protocols=protocols, )