From 761aa0f861662385934f0452aa01aa13deef2c83 Mon Sep 17 00:00:00 2001 From: Oliver Date: Mon, 29 Nov 2021 21:02:29 +1100 Subject: [PATCH] v0.5.3 - Updated translations - Improved error catching --- assets/release_notes.md | 4 +++- lib/api.dart | 4 ++++ lib/inventree/model.dart | 3 --- lib/l10n | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/assets/release_notes.md b/assets/release_notes.md index f353d52d..bae6449a 100644 --- a/assets/release_notes.md +++ b/assets/release_notes.md @@ -1,10 +1,12 @@ ## InvenTree App Release Notes --- -### 0. +### 0.5.3 - November 2021 --- +- Check for null value when reading user permissions - Updated Italian language translations +- Updated French language translations ### 0.5.2 - October 2021 --- diff --git a/lib/api.dart b/lib/api.dart index bd57cfb0..df44196b 100644 --- a/lib/api.dart +++ b/lib/api.dart @@ -480,6 +480,10 @@ class InvenTreeAPI { return true; } + if (roles[role] == null) { + return true; + } + try { List perms = List.from(roles[role] as List); return perms.contains(permission); diff --git a/lib/inventree/model.dart b/lib/inventree/model.dart index d894ae68..f6f88f73 100644 --- a/lib/inventree/model.dart +++ b/lib/inventree/model.dart @@ -285,9 +285,6 @@ class InvenTreeModel { // Return the detail view for the associated pk Future get(int pk, {Map filters = const {}}) async { - // TODO - Add "timeout" - // TODO - Add error catching - var url = path.join(URL, pk.toString()); if (!url.endsWith("/")) { diff --git a/lib/l10n b/lib/l10n index 0731397a..1ce6872e 160000 --- a/lib/l10n +++ b/lib/l10n @@ -1 +1 @@ -Subproject commit 0731397acd15f66067052d02f43e25e95c65bca9 +Subproject commit 1ce6872e6a9cd992b974bd21a41b1010dd569391