diff options
-rw-r--r-- | app/controllers/fax_documents_controller.rb | 10 | ||||
-rw-r--r-- | config/locales/views/fax_documents/de.yml | 1 | ||||
-rw-r--r-- | config/locales/views/fax_documents/en.yml | 1 |
3 files changed, 10 insertions, 2 deletions
diff --git a/app/controllers/fax_documents_controller.rb b/app/controllers/fax_documents_controller.rb index c2b3083..43852c6 100644 --- a/app/controllers/fax_documents_controller.rb +++ b/app/controllers/fax_documents_controller.rb @@ -61,8 +61,14 @@ class FaxDocumentsController < ApplicationController @fax_document = @fax_account.fax_documents.build(params[:fax_document]) @fax_document.retry_counter = @fax_account.retries if @fax_document.save - @fax_document.queue_for_sending! - redirect_to fax_account_fax_document_path(@fax_document.fax_account, @fax_document), :notice => t('fax_documents.controller.successfuly_created') + if @fax_document.tiff.blank? + @fax_document.destroy + @fax_document.errors.add(:document, t('fax_documents.controller.tiff_not_created')) + render :new + else + @fax_document.queue_for_sending! + redirect_to fax_account_fax_document_path(@fax_document.fax_account, @fax_document), :notice => t('fax_documents.controller.successfuly_created') + end else render :new end diff --git a/config/locales/views/fax_documents/de.yml b/config/locales/views/fax_documents/de.yml index da59833..236c031 100644 --- a/config/locales/views/fax_documents/de.yml +++ b/config/locales/views/fax_documents/de.yml @@ -5,6 +5,7 @@ de: successfuly_created: 'Eine neues Fax-Dokument wurde erstellt.' successfuly_updated: 'Das Fax-Dokument wurde aktualisiert.' successfuly_destroyed: 'Das Fax-Dokument wurde gelöscht.' + tiff_not_created: 'Konnte nicht konvertiert werden.' states: queued_for_sending: 'In der Warteschleife zum Versand' sending: 'Wird aktuell versendet' diff --git a/config/locales/views/fax_documents/en.yml b/config/locales/views/fax_documents/en.yml index ff5f8f8..0606e81 100644 --- a/config/locales/views/fax_documents/en.yml +++ b/config/locales/views/fax_documents/en.yml @@ -5,6 +5,7 @@ en: successfuly_created: 'Successfully created fax.' successfuly_updated: 'Successfully updated fax.' successfuly_destroyed: 'Successfully destroyed fax.' + tiff_not_created: 'Could not be converted.' states: queued_for_sending: 'Queued for sending' sending: 'Currently sending' |