~nataliabidart/magicicada-server/clean-deps-for-stable

« back to all changes in this revision

Viewing changes to magicicada/server/content.py

  • Committer: Natalia
  • Date: 2017-04-22 21:07:36 UTC
  • Revision ID: natalia.bidart@ubuntu.com-20170422210736-z6jl2p2v6fklfm0c
- Unified settings into a single file.
- Removed uneeded dependencies.
- Removed every outdated reference to "oauth".

Show diffs side-by-side

added added

removed removed

Lines of Context:
190
190
    def add_part(self, chunk_size):
191
191
        """Add a part to an upload job."""
192
192
        self.unsaved_count += chunk_size
193
 
        if self.unsaved_count >= settings.api_server.STORAGE_CHUNK_SIZE:
194
 
            self.unsaved_count -= settings.api_server.STORAGE_CHUNK_SIZE
 
193
        if self.unsaved_count >= settings.STORAGE_CHUNK_SIZE:
 
194
            self.unsaved_count -= settings.STORAGE_CHUNK_SIZE
195
195
            kwargs = dict(user_id=self.user.id, volume_id=self.volume_id,
196
196
                          uploadjob_id=self.uploadjob_id,
197
197
                          chunk_size=chunk_size)
870
870
        if upload is None:
871
871
            # no uploadjob found, create a new one: if the file is small just
872
872
            # get a bo
873
 
            if deflated_size <= settings.api_server.STORAGE_CHUNK_SIZE:
 
873
            if deflated_size <= settings.STORAGE_CHUNK_SIZE:
874
874
                upload = BogusUploadJob()
875
875
            else:
876
876
                try: