Skip to content

Commit

Permalink
Replace discriminatory terms
Browse files Browse the repository at this point in the history
  • Loading branch information
alecslupu committed Jan 31, 2023
1 parent 281ced3 commit 3a7dd4c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions decidim-admin/config/locales/en.yml
Expand Up @@ -375,8 +375,8 @@ en:
form:
domain_too_short: Domain too short
update:
error: Failed to update domain whitelist
success: Domain whitelist updated successfully
error: Failed to update domain allowlist
success: Domain allowlist updated successfully
exports:
export_as: "%{name} as %{export_format}"
formats:
Expand Down Expand Up @@ -843,8 +843,8 @@ en:
remove: Remove
up: Up
form:
add: Add to whitelist
title: External domain whitelist
add: Add to allowlist
title: External domain allowlist
organization_homepage:
content_blocks:
create:
Expand Down
4 changes: 2 additions & 2 deletions decidim-core/app/validators/password_validator.rb
Expand Up @@ -17,7 +17,7 @@ class PasswordValidator < ActiveModel::EachValidator
:email_included_in_password?,
:domain_included_in_password?,
:password_too_common?,
:blacklisted?,
:denied?,
:password_repeated?
].freeze

Expand Down Expand Up @@ -126,7 +126,7 @@ def domain_included_in_password?
false
end

def blacklisted?
def denied?
Array(Decidim.password_blacklist).each do |expression|
return true if expression.is_a?(Regexp) && value.match?(expression)
return true if expression.to_s == value
Expand Down
2 changes: 1 addition & 1 deletion decidim-core/config/locales/en.yml
Expand Up @@ -1893,7 +1893,7 @@ en:
name: English
name_with_error: English (error!)
password_validator:
blacklisted: is blacklisted
denied: is denied
domain_included_in_password: is too similar to this domain name
email_included_in_password: is too similar to your email
fallback: is not valid
Expand Down
4 changes: 2 additions & 2 deletions decidim-core/spec/validators/password_validator_spec.rb
Expand Up @@ -66,7 +66,7 @@

it "is blacklisted" do
expect(validator).to be(false)
expect(record.errors[attribute]).to eq(["is blacklisted"])
expect(record.errors[attribute]).to eq(["is denied"])
end
end

Expand All @@ -75,7 +75,7 @@

it "does not validate" do
expect(validator).to be(false)
expect(record.errors[attribute]).to eq(["is blacklisted"])
expect(record.errors[attribute]).to eq(["is denied"])
end
end

Expand Down

0 comments on commit 3a7dd4c

Please sign in to comment.