mirror of
https://github.com/internetee/registry.git
synced 2025-05-19 02:39:37 +02:00
lowered the minimum legalDocument size requirement to 3kB
This commit is contained in:
parent
fd97a74535
commit
00948384a6
3 changed files with 4 additions and 4 deletions
|
@ -29,13 +29,13 @@ $(document).on 'page:change', ->
|
||||||
$('.js-contact-form').trigger('restoreDefault')
|
$('.js-contact-form').trigger('restoreDefault')
|
||||||
|
|
||||||
$('[data-legal-document]').each (i, fileInput)->
|
$('[data-legal-document]').each (i, fileInput)->
|
||||||
minSize = 8 * 1024 # 8kB
|
minSize = 3 * 1024 # 3kB
|
||||||
maxSize = 8 * 1024 * 1024; # 8 MB
|
maxSize = 8 * 1024 * 1024; # 8 MB
|
||||||
$(fileInput).closest('form').submit (e) ->
|
$(fileInput).closest('form').submit (e) ->
|
||||||
if (files = fileInput.files).length
|
if (files = fileInput.files).length
|
||||||
fileSize = files[0].size
|
fileSize = files[0].size
|
||||||
if fileSize < minSize
|
if fileSize < minSize
|
||||||
alert 'Document size should be more than 8kB'
|
alert 'Document size should be more than 3kB'
|
||||||
return false
|
return false
|
||||||
else if fileSize > maxSize
|
else if fileSize > maxSize
|
||||||
alert 'Document size should be less than 8MB'
|
alert 'Document size should be less than 8MB'
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
class LegalDocument < ActiveRecord::Base
|
class LegalDocument < ActiveRecord::Base
|
||||||
include EppErrors
|
include EppErrors
|
||||||
MIN_BODY_SIZE = (1.37 * 8.kilobytes).ceil
|
MIN_BODY_SIZE = (1.37 * 3.kilobytes).ceil
|
||||||
|
|
||||||
if ENV['legal_document_types'].present?
|
if ENV['legal_document_types'].present?
|
||||||
TYPES = ENV['legal_document_types'].split(',').map(&:strip)
|
TYPES = ENV['legal_document_types'].split(',').map(&:strip)
|
||||||
|
|
|
@ -209,7 +209,7 @@ en:
|
||||||
legal_document:
|
legal_document:
|
||||||
attributes:
|
attributes:
|
||||||
body:
|
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:
|
attributes:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue