diff --git a/pydatalab/pydatalab/routes/v0_1/graphs.py b/pydatalab/pydatalab/routes/v0_1/graphs.py index 319f3a368..82c3d122c 100644 --- a/pydatalab/pydatalab/routes/v0_1/graphs.py +++ b/pydatalab/pydatalab/routes/v0_1/graphs.py @@ -72,7 +72,9 @@ def get_graph_cy_format(item_id: Optional[str] = None, collection_id: Optional[s drawn_elements = set() node_collections = set() for document in all_documents: - for relationship in document.get("relationships", []): + # for some reason, document["relationships"] is sometimes equal to None, so we + # need this `or` statement. + for relationship in document.get("relationships") or []: # only considering child-parent relationships if relationship.get("type") == "collections" and not collection_id: collection_data = flask_mongo.db.collections.find_one( @@ -113,7 +115,7 @@ def get_graph_cy_format(item_id: Optional[str] = None, collection_id: Optional[s ) continue - for relationship in document.get("relationships", []): + for relationship in document.get("relationships") or []: # only considering child-parent relationships: if relationship.get("relation") not in ("parent", "is_part_of"): continue diff --git a/webapp/.eslintrc.js b/webapp/.eslintrc.js index 17f2bd6a6..0942f3971 100644 --- a/webapp/.eslintrc.js +++ b/webapp/.eslintrc.js @@ -30,6 +30,6 @@ module.exports = { "cypress/no-assigning-return-values": "warn", "cypress/no-unnecessary-waiting": "warn", "cypress/unsafe-to-chain-command": "warn", - "prettier/prettier": "error", + "prettier/prettier": "warn", }, }; diff --git a/webapp/src/components/CollectionSelect.vue b/webapp/src/components/CollectionSelect.vue index 2b5b9a318..4b1e2fd51 100644 --- a/webapp/src/components/CollectionSelect.vue +++ b/webapp/src/components/CollectionSelect.vue @@ -6,6 +6,7 @@ multiple label="collection_id" :filterable="false" + placeholder="type to search..." @search="debouncedAsyncSearch" >