witten
/
luminotes
Archived
1
0
Fork 0

Updating storage quota calculation to only include notebooks that the user owns.

This commit is contained in:
Dan Helfman 2008-01-04 22:54:01 +00:00
parent 1b830c06a1
commit 28473599e0
1 changed files with 3 additions and 2 deletions

View File

@ -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 )