Skip to content

Commit

Permalink
Merge branch 'master' into feature/remaining-icat-endpoints-#145
Browse files Browse the repository at this point in the history
  • Loading branch information
MRichards99 committed Dec 2, 2020
2 parents 69f96bd + 7b72dc9 commit 4d00fb2
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
6 changes: 6 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
**Description**:
Add a description here

**Acceptance criteria**:
- [ ] A checklist
- [ ] of criteria to accept this story as done
15 changes: 15 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
This PR will close #{issue number}

## Description
Enter a description of the changes here

## Testing instructions
Add a set up instructions describing how the reviewer should test the code

- [ ] Review code
- [ ] Check Travis build
- [ ] Review changes to test coverage
- [ ] {more steps here}

## Agile board tracking
connect to #{issue number}
10 changes: 3 additions & 7 deletions common/icat/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,16 +266,12 @@ def map_distinct_attributes_to_entity_names(self, distinct_fields, included_fiel
if len(split_fields) == 1:
# Conventional list assignment causes IndexError because -2 is out of
# range of a list with a single element
split_fields.insert(-2, "base")
split_fields.insert(0, "base")

# If a key doesn't exist in the dictionary, create it and assign an empty
# list to it
try:
distinct_field_dict[split_fields[-2]]
except KeyError:
distinct_field_dict[split_fields[-2]] = []

distinct_field_dict[split_fields[-2]].append(split_fields[-1])
distinct_field_dict.setdefault(split_fields[0], [])
distinct_field_dict[split_fields[0]].append(split_fields[-1])

# Remove "base" key as this isn't a valid entity name in Python ICAT
distinct_entities = list(distinct_field_dict.keys())
Expand Down

0 comments on commit 4d00fb2

Please sign in to comment.