mirror of
https://github.com/GSA/notifications-api.git
synced 2026-07-31 11:48:51 -04:00
Add s3 method to remove transformed dvla files
This commit is contained in:
@@ -26,3 +26,10 @@ def remove_job_from_s3(service_id, job_id):
|
||||
file_location = FILE_LOCATION_STRUCTURE.format(service_id, job_id)
|
||||
obj = get_s3_object(bucket_name, file_location)
|
||||
return obj.delete()
|
||||
|
||||
|
||||
def remove_transformed_dvla_file(job_id):
|
||||
bucket_name = current_app.config['DVLA_UPLOAD_BUCKET_NAME']
|
||||
file_location = '{}-dvla-job.text'.format(job_id)
|
||||
obj = get_s3_object(bucket_name, file_location)
|
||||
return obj.delete()
|
||||
|
||||
@@ -14,7 +14,7 @@ from app.v2.notifications.notification_schemas import get_notifications_request
|
||||
def get_notification_by_id(id):
|
||||
try:
|
||||
casted_id = uuid.UUID(id)
|
||||
except ValueError or AttributeError:
|
||||
except (ValueError, AttributeError):
|
||||
abort(404)
|
||||
notification = notifications_dao.get_notification_with_personalisation(
|
||||
authenticated_service.id, casted_id, key_type=None
|
||||
|
||||
Reference in New Issue
Block a user