diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d6b36a2..89548604 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,15 @@ ml). ## testing +## [2.5.0] - 2022-11-30 +- [added] #407 erasure section with tabs in top. +- [added] #411 add new generic device as Other. +- [changed] #409 add backend pagination instead of javascript. +- [changed] #410 change teh top search for advanced search. +- [fixed] #412 show in snapshots log, type upload correctly. +- [fixed] #413 put order in documents. +- [fixed] #415 put prefix of lot in result of search. + ## [2.4.3] - 2022-11-18 - [added] #386 add registration module. - [added] #387 add template settings for Secure Erasure. diff --git a/ereuse_devicehub/__init__.py b/ereuse_devicehub/__init__.py index 5a8e0983..50062f87 100644 --- a/ereuse_devicehub/__init__.py +++ b/ereuse_devicehub/__init__.py @@ -1 +1 @@ -__version__ = "2.4.3" +__version__ = "2.5.0" diff --git a/ereuse_devicehub/inventory/views.py b/ereuse_devicehub/inventory/views.py index fe1c37e7..b9c3a659 100644 --- a/ereuse_devicehub/inventory/views.py +++ b/ereuse_devicehub/inventory/views.py @@ -141,6 +141,7 @@ class ErasureListView(DeviceListMixin): ) if orphans: schema = app.config.get('SCHEMA') + _user = g.user.id sql = f""" select action.id from {schema}.action as action inner join {schema}.erase_basic as erase @@ -149,11 +150,14 @@ class ErasureListView(DeviceListMixin): on device.id=action.parent_id inner join {schema}.placeholder as placeholder on placeholder.binding_id=device.id - where action.parent_id is null or placeholder.kangaroo=true + where (action.parent_id is null or placeholder.kangaroo=true) + and action.author_id='{_user}' """ ids = (e[0] for e in db.session.execute(sql)) - erasure = EraseBasic.query.filter(EraseBasic.id.in_(ids)).order_by( - EraseBasic.created.desc() + erasure = ( + EraseBasic.query.filter(EraseBasic.id.in_(ids)) + .filter_by(author=g.user) + .order_by(EraseBasic.created.desc()) ) self.context['orphans'] = True diff --git a/ereuse_devicehub/parser/models.py b/ereuse_devicehub/parser/models.py index bdd13f73..6d8cdb4e 100644 --- a/ereuse_devicehub/parser/models.py +++ b/ereuse_devicehub/parser/models.py @@ -73,7 +73,7 @@ class SnapshotsLog(Thing): snapshots = [] for s in self.snapshot.device.actions: if s == self.snapshot: - continue + break if s.type == self.snapshot.type: snapshots.append(s) return snapshots and 'Update' or 'New Device' diff --git a/ereuse_devicehub/resources/tradedocument/models.py b/ereuse_devicehub/resources/tradedocument/models.py index 7f211637..07af62d1 100644 --- a/ereuse_devicehub/resources/tradedocument/models.py +++ b/ereuse_devicehub/resources/tradedocument/models.py @@ -172,7 +172,9 @@ class TradeDocument(Thing): return sorted(ev for ev in actions if ev.severity >= Severity.Warning) def __lt__(self, other): - return self.id < other.id + if self.id and other.id: + return self.id < other.id + return False def __str__(self) -> str: return '{0.file_name}'.format(self) diff --git a/ereuse_devicehub/templates/inventory/search.html b/ereuse_devicehub/templates/inventory/search.html index 9f724586..57f62975 100644 --- a/ereuse_devicehub/templates/inventory/search.html +++ b/ereuse_devicehub/templates/inventory/search.html @@ -16,7 +16,7 @@