mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-21 14:59:47 -04:00
Add endpoint to redirect from contact list to send
In order to use a contact list we’re going to put you in the normal upload a spreadsheet journey. Except without having to upload again. So this commit adds an endpoint that takes the file from the contact list bucket, puts it in the same place it would have gone if you’d uploaded it, then sends you on your way.
This commit is contained in:
@@ -51,6 +51,22 @@ 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)
|
||||
new_upload_id = s3upload(
|
||||
service_id,
|
||||
contents,
|
||||
current_app.config['AWS_REGION'],
|
||||
)
|
||||
set_metadata_on_csv_upload(
|
||||
service_id,
|
||||
new_upload_id,
|
||||
**metadata,
|
||||
)
|
||||
return new_upload_id
|
||||
|
||||
@classmethod
|
||||
def create(cls, service_id, upload_id):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user