Skip to content

Commit

Permalink
Making keyvalue more robust to failures (#613)
Browse files Browse the repository at this point in the history
Related-Issue: #613
Projected-Results-Impact: none
  • Loading branch information
holtgrewe committed Aug 24, 2022
1 parent e1bf4bf commit 6848306
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions HISTORY.rst
Expand Up @@ -73,6 +73,7 @@ Full Change List
- Bugfix broken SV filter (#587).
- Fixed bug where Exac and thousand genomes settings were not shown in frequency tab for GRCh37 (#597).
- Form template reports error if genomebuild variable is not set (#607).
- Making ``keyvalue`` more robust to failure (#613).

------
v1.2.0
Expand Down
4 changes: 3 additions & 1 deletion templatetags/templatetags/dict.py
Expand Up @@ -5,7 +5,9 @@

@register.filter
def keyvalue(data, key):
if hasattr(data, "get"):
if data is None:
return None
elif hasattr(data, "get"):
return data.get(key)
else:
return data[key]

0 comments on commit 6848306

Please sign in to comment.