Pass original file name when sending contact list

Otherwise the new file doesn’t get a name, which is very confusing.
This commit is contained in:
Chris Hill-Scott
2020-03-16 11:25:07 +00:00
parent b99216173e
commit 93f862621c
3 changed files with 13 additions and 8 deletions

View File

@@ -76,17 +76,15 @@ class ContactList(JSONModel):
bucket=ContactList.get_bucket_name(),
)
@staticmethod
def copy_to_uploads(service_id, upload_id):
contents = ContactList.download(service_id, upload_id)
metadata = ContactList.get_metadata(service_id, upload_id)
def copy_to_uploads(self):
metadata = self.get_metadata(self.service_id, self.id)
new_upload_id = s3upload(
service_id,
{'data': contents},
self.service_id,
{'data': self.contents},
current_app.config['AWS_REGION'],
)
set_metadata_on_csv_upload(
service_id,
self.service_id,
new_upload_id,
**metadata,
)