Skip to content

Commit

Permalink
release: always assign name from server data
Browse files Browse the repository at this point in the history
Prior to this change, if a user created a Release class by specifying an
ID number instead of a name string, the class would always set the name
property to None. For example, this would be None:

  Release(id=1234).name

Assign name when we process all the other data attributes in _setattr().
  • Loading branch information
ktdreyer committed Jul 19, 2023
1 parent f629b3b commit 910b054
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions errata_tool/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def _setattr(self):
self.attributes = self.data['attributes']
self.relationships = self.data['relationships']
self.id = self.data['id']
self.name = self.attributes['name']
self.program_manager = \
self.relationships['program_manager']['login_name'] if \
self.relationships.get('program_manager') else None
Expand Down

0 comments on commit 910b054

Please sign in to comment.