aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2023-07-11 15:32:50 +0300
committerFrederick Muriuki Muriithi2023-07-11 15:32:50 +0300
commit904dd7733beea34aa449f72246746b5a7fdcc8ea (patch)
tree707bdfe66e90c5287f47f37e7ad2e241b388056a
parent01ce1af9809d1ecf2e8db4636657ee4bd4551bcc (diff)
downloadgenenetwork2-904dd7733beea34aa449f72246746b5a7fdcc8ea.tar.gz
BugFix: Display diff file only once
The code filtering the diffs to ensure that only the diffs for the traits that the user has access to are visible was leading to the diffs that relate to the same trait showing up more than once. This commit fixes that, ensuring that each diff shows up once.
-rw-r--r--wqflask/wqflask/metadata_edits.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/wqflask/wqflask/metadata_edits.py b/wqflask/wqflask/metadata_edits.py
index 7b921a6d..141a6711 100644
--- a/wqflask/wqflask/metadata_edits.py
+++ b/wqflask/wqflask/metadata_edits.py
@@ -514,12 +514,12 @@ def list_diffs():
def __filter_authorised__(diffs, auth_details):
"""Retain only those diffs that the current user has edit access to."""
- return [
- diff for diff in diffs
+ return list({
+ diff["filepath"]: diff for diff in diffs
for auth in auth_details
if (diff["diff"]["dataset_name"] == auth["dataset_name"]
- and
- diff["diff"]["trait_name"] == auth["trait_name"]) ]
+ and
+ diff["diff"]["trait_name"] == auth["trait_name"]) }.values())
def __organise_diffs__(acc, item):
if item["filepath"].name.endswith(".rejected"):