Remove letter sending route without file_id

All instances of the app will be posting to the URL with the `file_id`
parameter now, so we can remove the old route without the ID now.
This commit is contained in:
Chris Hill-Scott
2020-05-19 18:19:07 +01:00
parent 846510fa31
commit 3378dfe258
3 changed files with 11 additions and 67 deletions

View File

@@ -338,15 +338,13 @@ def view_letter_upload_as_preview(service_id, file_id):
return TemplatePreview.from_valid_pdf_file(pdf_file, page)
@main.route("/services/<uuid:service_id>/upload-letter/send", methods=['POST'])
@main.route("/services/<uuid:service_id>/upload-letter/send/<uuid:file_id>", methods=['POST'])
@user_has_permissions('send_messages', restrict_admin_usage=True)
def send_uploaded_letter(service_id, file_id=None):
if not (current_service.has_permission('letter') and current_service.has_permission('upload_letters')):
abort(403)
form = LetterUploadPostageForm(file_id=file_id)
file_id = file_id or form.file_id.data
form = LetterUploadPostageForm()
if not form.validate_on_submit():
return uploaded_letter_preview(service_id, file_id)