Commits

Tobias McNulty committed a1fea71 Draft

only pass encrypt_key if True

  • Participants
  • Parent commits 65b3658

Comments (0)

Files changed (1)

File storages/backends/s3boto.py

             self._entries[encoded_name] = key
 
         key.set_metadata('Content-Type', content_type)
+        # only pass backwards incompatible arguments if they vary from the default
+        kwargs = {}
+        if self.encryption:
+            kwargs['encrypt_key'] = self.encryption
         key.set_contents_from_file(content, headers=headers, policy=self.acl,
                                    reduced_redundancy=self.reduced_redundancy,
-                                   encrypt_key=self.encryption)
+                                   **kwargs)
         return cleaned_name
 
     def delete(self, name):