Fix site size calculation
This commit is contained in:
parent
16ed55a745
commit
3c5e4e64ca
1 changed files with 3 additions and 2 deletions
|
@ -599,8 +599,6 @@ class ContentManager(object):
|
||||||
|
|
||||||
content_size_optional = sum([file["size"] for file in content.get("files_optional", {}).values()])
|
content_size_optional = sum([file["size"] for file in content.get("files_optional", {}).values()])
|
||||||
site_size = self.site.settings["size"] - old_content_size + content_size # Site size without old content plus the new
|
site_size = self.site.settings["size"] - old_content_size + content_size # Site size without old content plus the new
|
||||||
if site_size > self.site.settings.get("size", 0):
|
|
||||||
self.site.settings["size"] = site_size # Save to settings if larger
|
|
||||||
|
|
||||||
site_size_limit = self.site.getSizeLimit() * 1024 * 1024
|
site_size_limit = self.site.getSizeLimit() * 1024 * 1024
|
||||||
|
|
||||||
|
@ -623,6 +621,7 @@ class ContentManager(object):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if inner_path == "content.json":
|
if inner_path == "content.json":
|
||||||
|
self.site.settings["size"] = site_size # Save to settings if larger
|
||||||
return True # Root content.json is passed
|
return True # Root content.json is passed
|
||||||
|
|
||||||
# Load include details
|
# Load include details
|
||||||
|
@ -662,6 +661,8 @@ class ContentManager(object):
|
||||||
self.log.error("%s: Includes not allowed" % inner_path)
|
self.log.error("%s: Includes not allowed" % inner_path)
|
||||||
return False # Includes not allowed
|
return False # Includes not allowed
|
||||||
|
|
||||||
|
self.site.settings["size"] = site_size # Save to settings if larger
|
||||||
|
|
||||||
return True # All good
|
return True # All good
|
||||||
|
|
||||||
# Verify file validity
|
# Verify file validity
|
||||||
|
|
Loading…
Reference in a new issue