Skip to content
Snippets Groups Projects
Commit 3b5b56e5 authored by inso's avatar inso
Browse files

Fix bug with version parsing

parent a499bc0f
No related branches found
No related tags found
No related merge requests found
...@@ -173,9 +173,14 @@ class BmaAccess(QObject): ...@@ -173,9 +173,14 @@ class BmaAccess(QObject):
self._rollback_to = 0 self._rollback_to = 0
def filter_nodes(self, request, nodes): def filter_nodes(self, request, nodes):
def compare_versions(node, version):
try:
return StrictVersion(node.version) > StrictVersion(version)
except TypeError:
return False
filters = { filters = {
bma.ud.History: lambda n: StrictVersion(n) > StrictVersion("0.11.0"), bma.ud.History: lambda n: compare_versions(n, "0.11.0"),
bma.tx.History: lambda n: StrictVersion(n) > StrictVersion("0.11.0") bma.tx.History: lambda n: compare_versions(n, "0.11.0")
} }
if request in filters: if request in filters:
return [n for n in nodes if filters[request](n)] return [n for n in nodes if filters[request](n)]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment