Skip to content

Commit

Permalink
Fix missing attributes in MW 1.35 (#326)
Browse files Browse the repository at this point in the history
* Update baseentity.py

fix #325

* Update baseentity.py

Co-authored-by: Myst <1592048+LeMyst@users.noreply.github.com>
  • Loading branch information
dpriskorn and LeMyst authored May 3, 2022
1 parent 04a6f4c commit 189b102
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions wikibaseintegrator/entities/baseentity.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,10 @@ def from_json(self, json_data: Dict[str, Any]) -> BaseEntity:
if 'missing' in json_data:
raise ValueError('Entity is nonexistent')

self.title = str(json_data['title'])
self.pageid = int(json_data['pageid'])
if 'title' in json_data: # TODO: 1.35 compatibility
self.title = str(json_data['title'])
if 'pageid' in json_data: # TODO: 1.35 compatibility
self.pageid = int(json_data['pageid'])
self.lastrevid = int(json_data['lastrevid'])
self.type = str(json_data['type'])
self.id = str(json_data['id'])
Expand Down

1 comment on commit 189b102

@dpriskorn
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, thanks for looking into this so fast. 🤩

Please sign in to comment.