Skip to content

Commit

Permalink
simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
matijakolaric committed Dec 19, 2019
1 parent d54c1de commit 1618d6a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions music_metadata/edi/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@ def to_html(self, value, label='', error=None):

def to_dict(self, record, label=None, verbosity=1):
"""Create the dictionary with the value and additional data."""
if label is None:
label = self._name
value = getattr(record, label)
value = getattr(record, label or self._name)
valid = record.valid or label not in record.errors
if value is None and valid and verbosity <= 1:
return None
Expand Down

0 comments on commit 1618d6a

Please sign in to comment.