Skip to content

Commit

Permalink
Merge pull request #62 from cityofaustin/1.0.11
Browse files Browse the repository at this point in the history
Fix Record __repr__ to handle nonetype case
  • Loading branch information
johnclary authored Aug 20, 2020
2 parents f56d922 + 6dafd4b commit cbe917f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
6 changes: 3 additions & 3 deletions coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/developer_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ After running the tests, you can use `$ coverage html` to generate HTML document
You can update the coverage badge image with:

```bash
$ coverage-badge -o coverage.svg
$ coverage-badge -f -o coverage.svg
```

## Linting and Formatting
Expand Down
4 changes: 1 addition & 3 deletions knackpy/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ def __init__(self, data, field_defs, identifier, timezone):
self.immutable = True

def __repr__(self):
identifier_value = self.data[self.identifier]
# if the identifier field has no value, use the record ID
identifier_value = identifier_value if identifier_value else self.data["id"]
identifier_value = self.data[self.identifier] if self.identifier else self.data["id"]
return f"<Record '{identifier_value}'>"

def __getitem__(self, client_key):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def build_config(env, readme="README.md"):
"packages": ["knackpy"],
"tests_require": ["pytest", "coverage"],
"url": "http://github.com/cityofaustin/knackpy",
"version": "1.0.10",
"version": "1.0.11",
}


Expand Down

0 comments on commit cbe917f

Please sign in to comment.