lowered the minimum legalDocument size requirement to 3kB

This commit is contained in:
Timo Võhmar 2016-04-07 11:40:02 +03:00
parent fd97a74535
commit 00948384a6
3 changed files with 4 additions and 4 deletions

View file

@ -29,13 +29,13 @@ $(document).on 'page:change', ->
$('.js-contact-form').trigger('restoreDefault')
$('[data-legal-document]').each (i, fileInput)->
minSize = 8 * 1024 # 8kB
minSize = 3 * 1024 # 3kB
maxSize = 8 * 1024 * 1024; # 8 MB
$(fileInput).closest('form').submit (e) ->
if (files = fileInput.files).length
fileSize = files[0].size
if fileSize < minSize
alert 'Document size should be more than 8kB'
alert 'Document size should be more than 3kB'
return false
else if fileSize > maxSize
alert 'Document size should be less than 8MB'

View file

@ -1,6 +1,6 @@
class LegalDocument < ActiveRecord::Base
include EppErrors
MIN_BODY_SIZE = (1.37 * 8.kilobytes).ceil
MIN_BODY_SIZE = (1.37 * 3.kilobytes).ceil
if ENV['legal_document_types'].present?
TYPES = ENV['legal_document_types'].split(',').map(&:strip)

View file

@ -209,7 +209,7 @@ en:
legal_document:
attributes:
body:
length: 'Parameter value policy error: legalDocument size should be more than 8kB'
length: 'Parameter value policy error: legalDocument size should be more than 3kB'
attributes: