Skip to content

Commit

Permalink
Fix for linter
Browse files Browse the repository at this point in the history
  • Loading branch information
Arpi committed May 23, 2024
1 parent 3d7ed72 commit 042f642
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions decidim-core/app/validators/etiquette_validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ class EtiquetteValidator < ActiveModel::EachValidator
include ActionView::Helpers::SanitizeHelper

def validate_each(record, attribute, value)

# remove HTML tags, from WYSIWYG editor
value = clean_value(value)

Expand All @@ -24,7 +23,7 @@ def validate_each(record, attribute, value)
def validate_caps(record, attribute, value)
# to prevent :too_much_caps error when there are no caps and 1-3 char string
caps = value.scan(/[A-Z]/).length
return if caps == 0 || value.scan(/[A-Z]/).length < value.length / 4
return if caps.zero? || value.scan(/[A-Z]/).length < value.length / 4

record.errors.add(attribute, options[:message] || :too_much_caps)
end
Expand Down

0 comments on commit 042f642

Please sign in to comment.