[CalendarServer-changes] [7727] CalendarServer/branches/users/glyph/disable-quota/twistedcaldav/ resource.py

source_changes at macosforge.org source_changes at macosforge.org
Thu Jul 7 02:35:44 PDT 2011


Revision: 7727
          http://trac.macosforge.org/projects/calendarserver/changeset/7727
Author:   glyph at apple.com
Date:     2011-07-07 02:35:44 -0700 (Thu, 07 Jul 2011)
Log Message:
-----------
make hasQuotaRoot read from the backend, not from config.

Modified Paths:
--------------
    CalendarServer/branches/users/glyph/disable-quota/twistedcaldav/resource.py

Modified: CalendarServer/branches/users/glyph/disable-quota/twistedcaldav/resource.py
===================================================================
--- CalendarServer/branches/users/glyph/disable-quota/twistedcaldav/resource.py	2011-07-07 09:35:32 UTC (rev 7726)
+++ CalendarServer/branches/users/glyph/disable-quota/twistedcaldav/resource.py	2011-07-07 09:35:44 UTC (rev 7727)
@@ -2062,27 +2062,32 @@
     def isCollection(self):
         return True
 
+
     def quotaSize(self, request):
         # FIXME: tests, workingness
         return succeed(0)
 
+
     def hasQuotaRoot(self, request):
         """
-        Always get quota root value from config.
+        Is this resource a quota root?  This returns True if the backend is
+        enforcing quota.
 
         @return: a C{True} if this resource has quota root, C{False} otherwise.
         """
-        return config.UserQuota != 0
-    
+        return self._newStoreHome.quotaAllowedBytes() is None
+
+
     def quotaRoot(self, request):
         """
-        Always get quota root value from config.
+        Retrieve the number of total allowed bytes from the backend.
 
         @return: a C{int} containing the maximum allowed bytes if this
             collection is quota-controlled, or C{None} if not quota controlled.
         """
         return self._newStoreHome.quotaAllowedBytes()
 
+
     def currentQuotaUse(self, request):
         """
         Get the quota use value
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110707/8f971c47/attachment.html>


More information about the calendarserver-changes mailing list