mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-10 16:27:51 -06:00
CURA-5035 Crash because old packages don't have 'author_id'
This commit is contained in:
parent
51abd32328
commit
096f304aef
3 changed files with 21 additions and 18 deletions
|
@ -43,13 +43,14 @@ class PackagesModel(ListModel):
|
|||
items = []
|
||||
|
||||
for package in self._metadata:
|
||||
print(package["author"])
|
||||
items.append({
|
||||
"id": package["package_id"],
|
||||
"type": package["package_type"],
|
||||
"name": package["display_name"],
|
||||
"version": package["package_version"],
|
||||
"author_id": package["author"]["author_id"],
|
||||
"author_name": package["author"]["display_name"],
|
||||
"author_id": package["author"]["author_id"] if "author_id" in package["author"] else package["author"]["name"],
|
||||
"author_name": package["author"]["display_name"] if "display_name" in package["author"] else package["author"]["name"],
|
||||
"author_email": package["author"]["email"] if "email" in package["author"] else "None",
|
||||
"description": package["description"],
|
||||
"icon_url": package["icon_url"] if "icon_url" in package else None,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue