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

Fix bug with filter nodes and account registration

parent a89b532e
No related branches found
No related tags found
No related merge requests found
......@@ -361,7 +361,8 @@ class Account(QObject):
try:
data = yield from community.bma_access.simple_request(request,
req_args={'search': search})
registered = parsers[request](data)
if data:
registered = parsers[request](data)
tries += 1
except ValueError as e:
if '404' in str(e) or '400' in str(e):
......
......@@ -197,9 +197,12 @@ class BmaAccess(QObject):
def filter_nodes(self, request, nodes):
def compare_versions(node, version):
try:
return StrictVersion(node.version) > StrictVersion(version)
except TypeError:
if node.version and node.version != '':
try:
return StrictVersion(node.version) > StrictVersion(version)
except TypeError:
return False
else:
return False
filters = {
bma.ud.History: lambda n: compare_versions(n, "0.11.0"),
......
......@@ -42,7 +42,7 @@ def async_exception_handler(loop, context):
logging.error('\n'.join(log_lines), exc_info=exc_info)
if "Unclosed" not in message and \
"gaierror(-2" not in message:
"socket.gaierror" not in message:
os._exit(1)
......
......@@ -48,6 +48,9 @@ class TestBmaAccess(unittest.TestCase):
res = self.bma_access._compare_json({}, corrupted.bma_null_data)
self.assertFalse(res)
def test_filter_nodes(self):
pass#TODO
if __name__ == '__main__':
logging.basicConfig(stream=sys.stderr)
logging.getLogger().setLevel(logging.DEBUG)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment