use right bucket for doc class

This commit is contained in:
James Turk 2012-05-15 15:50:36 -04:00
parent cec4bdc333
commit 76e172da0f

View File

@ -24,9 +24,9 @@ class S3Storage(object):
def put(self, tracked_doc, data, content_type):
""" upload the document to S3 """
k = boto.s3.key.Key(self.bucket)
aws_prefix = self._get_opt(tracked_doc['doc_class'], 'AWS_PREFIX', '')
aws_bucket = self._get_opt(tracked_doc['doc_class'], 'AWS_BUCKET')
k = boto.s3.key.Key(aws_bucket)
key_name = aws_prefix + tracked_doc['_id']
k.key = key_name
headers = {'x-amz-acl': 'public-read',