diff --git a/openquake/commands/engine.py b/openquake/commands/engine.py
index <HASH>..<HASH> 100644
--- a/openquake/commands/engine.py
+++ b/openquake/commands/engine.py
@@ -42,7 +42,7 @@ def read(calc_id, username=None):
     :param username: if given, restrict the search to the user's calculations
     :returns: the associated DataStore instance
     """
-    if calc_id == -1 and not username:
+    if calc_id < 0 and not username:
         # get the last calculation in the datastore of the current user
         return datastore.read(calc_id)
     job = logs.dbcmd('get_job', calc_id, username)
Small fix [skip CI]