Skip to content

Commit

Permalink
Gene collection update time corresponds to last gene creation date (#…
Browse files Browse the repository at this point in the history
…3328)

* Gene collection update time corresponds to last gene creation date

* This works
  • Loading branch information
northwestwitch authored May 6, 2022
1 parent 06f10bc commit 8ec4756
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ About changelog [here](https://keepachangelog.com/en/1.0.0/)
- Handle `no intervals found` warning in load_region test
- Beacon remove variants
- Protect remote_cors function in alignviewers view from Server-Side Request Forgery (SSRF)
- Check creation date of last document in gene collection to display when genes collection was updated last

## [4.51]
### Added
Expand Down
3 changes: 2 additions & 1 deletion scout/server/blueprints/genes/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ def genes(store, query):
nr_genes_37 = store.nr_genes(build="37")
nr_genes_38 = store.nr_genes(build="38")
genes_subset = list(store.all_genes(add_transcripts=False, limit=20))
last_updated = document_generated(genes_subset[0]["_id"] if genes_subset else None)
last_inserted_gene = store.hgnc_collection.find({}).sort("_id", -1).limit(1)
last_updated = document_generated(last_inserted_gene[0]["_id"] if last_inserted_gene else None)
return dict(genes=genes_subset, last_updated=last_updated, nr_genes=(nr_genes_37, nr_genes_38))


Expand Down

0 comments on commit 8ec4756

Please sign in to comment.