diff --git a/docs/changelog.rst b/docs/changelog.rst index 07ccf87..574ae0d 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,6 +1,8 @@ Changelog ========= +* :bug:`-` fix division by zero for hosting packages without disk space allocation + * :release:`0.14.1 <2023-07-22>` * :bug:`-` fix squashed migration for disk space statistics diff --git a/gnuviechadmin/hostingpackages/models.py b/gnuviechadmin/hostingpackages/models.py index 0f2a111..5565a2f 100644 --- a/gnuviechadmin/hostingpackages/models.py +++ b/gnuviechadmin/hostingpackages/models.py @@ -290,6 +290,8 @@ class CustomerHostingPackage(HostingPackageBase): used_disk_space_sum = property(get_used_disk_space_sum) def get_space_level(self): + if not self.diskspace: + return 100.0 return self.used_disk_space_sum / self.disk_space * 100.0 space_level = property(get_space_level)