Fix site size calculation

This commit is contained in:
shortcutme 2016-08-15 13:56:04 +02:00
parent 16ed55a745
commit 3c5e4e64ca
1 changed files with 3 additions and 2 deletions

View File

@ -599,8 +599,6 @@ class ContentManager(object):
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
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
@ -623,6 +621,7 @@ class ContentManager(object):
return False
if inner_path == "content.json":
self.site.settings["size"] = site_size # Save to settings if larger
return True # Root content.json is passed
# Load include details
@ -662,6 +661,8 @@ class ContentManager(object):
self.log.error("%s: Includes not allowed" % inner_path)
return False # Includes not allowed
self.site.settings["size"] = site_size # Save to settings if larger
return True # All good
# Verify file validity