From: Michael Tremer Date: Thu, 19 Oct 2023 13:03:29 +0000 (+0000) Subject: users: Return 0 when no quota has been used X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=458e67b3877311f23b926adca00f23a53b2fc0c3;p=pbs.git users: Return 0 when no quota has been used Signed-off-by: Michael Tremer --- diff --git a/src/buildservice/users.py b/src/buildservice/users.py index 84e3a8c7..7ad74179 100644 --- a/src/buildservice/users.py +++ b/src/buildservice/users.py @@ -722,10 +722,15 @@ class User(base.DataObject): if res: return res.used + return 0 + def has_exceeded_build_quota(self): if not self.daily_build_quota: return False + if not self.used_daily_build_quota: + return False + return self.used_daily_build_quota >= self.daily_build_quota # Storage Quota