diff --git a/controller/Files.py b/controller/Files.py index 64633f8..e48416d 100644 --- a/controller/Files.py +++ b/controller/Files.py @@ -681,7 +681,9 @@ class Files( object ): rate_plan = self.__users.rate_plan( user.rate_plan ) - if user.storage_bytes + uploading_file.content_length > rate_plan.get( u"storage_quota_bytes", 0 ) * SOFT_QUOTA_FACTOR: + storage_quota_bytes = rate_plan.get( u"storage_quota_bytes" ) + if storage_quota_bytes and \ + user.storage_bytes + uploading_file.content_length > storage_quota_bytes * SOFT_QUOTA_FACTOR: return stream_quota_error() return stream_progress( uploading_file, filename, fraction_reported ) diff --git a/controller/test/Test_files.py b/controller/test/Test_files.py index 0af5955..90cf732 100644 --- a/controller/test/Test_files.py +++ b/controller/test/Test_files.py @@ -1315,6 +1315,10 @@ class Test_files( Test_controller ): self.assert_streaming_error( result, u"quota" ) + def test_progress_no_quota( self ): + self.settings[ u"global" ][ u"luminotes.rate_plans" ][ 1 ][ u"storage_quota_bytes" ] = None + self.test_progress() + def test_stats( self ): self.login() orig_storage_bytes = self.user.storage_bytes