Updating storage quota calculation to only include notebooks that the user owns.
This commit is contained in:
parent
1b830c06a1
commit
28473599e0
|
@ -217,8 +217,8 @@ class User( Persistent ):
|
||||||
def sql_calculate_storage( self ):
|
def sql_calculate_storage( self ):
|
||||||
"""
|
"""
|
||||||
Return a SQL string to calculate the total bytes of storage usage by this user. Note that this
|
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
|
only includes storage for all the user's notes and past revisions in notebooks that they own. It
|
||||||
for the notebooks themselves.
|
doesn't include storage for the notebooks themselves.
|
||||||
"""
|
"""
|
||||||
return \
|
return \
|
||||||
"""
|
"""
|
||||||
|
@ -228,6 +228,7 @@ class User( Persistent ):
|
||||||
user_notebook, note
|
user_notebook, note
|
||||||
where
|
where
|
||||||
user_notebook.user_id = %s and
|
user_notebook.user_id = %s and
|
||||||
|
user_notebook.owner = 't' and
|
||||||
note.notebook_id = user_notebook.notebook_id;
|
note.notebook_id = user_notebook.notebook_id;
|
||||||
""" % quote( self.object_id )
|
""" % quote( self.object_id )
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user