summaryrefslogtreecommitdiff
path: root/app/controllers/fax_documents_controller.rb
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-03-07 11:37:03 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-03-07 11:37:03 +0100
commit11f186a118285fbc87a536af26730780a9ad01f5 (patch)
treefe6363b036f60f238916d070b3d0cb0625dd53c8 /app/controllers/fax_documents_controller.rb
parent2b94b16ee1201d15b3b9d66e142df311141a47db (diff)
parent3e19646f46c772e10ed3d7a45e8c974ab23f625b (diff)
Merge branch 'develop'5.1.1
Diffstat (limited to 'app/controllers/fax_documents_controller.rb')
-rw-r--r--app/controllers/fax_documents_controller.rb10
1 files changed, 8 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