mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-22 17:53:48 -04:00
fix blank lines at end of csv
This commit is contained in:
@@ -29,6 +29,10 @@ def get_csv_upload(service_id, upload_id):
|
||||
|
||||
|
||||
def s3upload(service_id, filedata):
|
||||
# sometimes people upload files with hundreds of blank lines at the end
|
||||
data = filedata["data"]
|
||||
cleaned_data = "\n".join(line for line in data.splitlines() if line.strip())
|
||||
filedata["data"] = cleaned_data
|
||||
|
||||
upload_id = str(uuid.uuid4())
|
||||
bucket_name, file_location, access_key, secret_key, region = get_csv_location(
|
||||
|
||||
Reference in New Issue
Block a user