From 28473599e02702ee1e8b150fb8e11336d6049270 Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Fri, 4 Jan 2008 22:54:01 +0000 Subject: [PATCH] Updating storage quota calculation to only include notebooks that the user owns. --- model/User.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/model/User.py b/model/User.py index 58b7e6d..aa07d44 100644 --- a/model/User.py +++ b/model/User.py @@ -217,8 +217,8 @@ class User( Persistent ): def sql_calculate_storage( self ): """ Return a SQL string to calculate the total bytes of storage usage by this user. Note that this - only includes storage for all the user's notes and past revisions. It doesn't include storage - for the notebooks themselves. + only includes storage for all the user's notes and past revisions in notebooks that they own. It + doesn't include storage for the notebooks themselves. """ return \ """ @@ -228,6 +228,7 @@ class User( Persistent ): user_notebook, note where user_notebook.user_id = %s and + user_notebook.owner = 't' and note.notebook_id = user_notebook.notebook_id; """ % quote( self.object_id )