Skip to content

Commit

Permalink
Merge pull request #912 from mishfit/allowEmptyFileQueryFilters
Browse files Browse the repository at this point in the history
Allow empty fileQuery filters
  • Loading branch information
HelloZeroNet authored May 6, 2017
2 parents 9a772ea + 270eb67 commit e9b2c76
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Ui/UiWebsocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def start(self):
except Exception, err:
if config.debug: # Allow websocket errors to appear on /Debug
sys.modules["main"].DebugHook.handleError()
self.log.error("WebSocket handleRequest error: %s" % Debug.formatException(err))
self.log.error("WebSocket handleRequest error: %s \n %s" % (Debug.formatException(err), message))
self.cmd("error", "Internal error: %s" % Debug.formatException(err, "html"))

# Has permission to run the command
Expand Down Expand Up @@ -516,10 +516,10 @@ def actionFileDelete(self, to, inner_path):
ws.event("siteChanged", self.site, {"event": ["file_deleted", inner_path]})

# Find data in json files
def actionFileQuery(self, to, dir_inner_path, query):
def actionFileQuery(self, to, dir_inner_path, query=None):
# s = time.time()
dir_path = self.site.storage.getPath(dir_inner_path)
rows = list(QueryJson.query(dir_path, query))
rows = list(QueryJson.query(dir_path, query or ""))
# self.log.debug("FileQuery %s %s done in %s" % (dir_inner_path, query, time.time()-s))
return self.response(to, rows)

Expand Down

0 comments on commit e9b2c76

Please sign in to comment.