Drop error if want to publish non existent file
This commit is contained in:
parent
c5d90ddd19
commit
c2b177434d
1 changed files with 3 additions and 0 deletions
|
@ -405,6 +405,9 @@ class UiWebsocket(object):
|
||||||
self.site.saveSettings()
|
self.site.saveSettings()
|
||||||
self.site.announce()
|
self.site.announce()
|
||||||
|
|
||||||
|
if not inner_path in self.site.content_manager.contents:
|
||||||
|
return self.response(to, {"error": "File %s not found" % inner_path})
|
||||||
|
|
||||||
event_name = "publish %s %s" % (self.site.address, inner_path)
|
event_name = "publish %s %s" % (self.site.address, inner_path)
|
||||||
called_instantly = RateLimit.isAllowed(event_name, 30)
|
called_instantly = RateLimit.isAllowed(event_name, 30)
|
||||||
thread = RateLimit.callAsync(event_name, 30, self.doSitePublish, self.site, inner_path) # Only publish once in 30 seconds
|
thread = RateLimit.callAsync(event_name, 30, self.doSitePublish, self.site, inner_path) # Only publish once in 30 seconds
|
||||||
|
|
Loading…
Reference in a new issue