Skip to content

Commit

Permalink
Avoid double-redaction of senders/principals in defamations
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-hank committed Aug 31, 2022
1 parent c741d44 commit ef769ef
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). It uses [CalVer](https://calver.org/) as of May 2019.

## [22.08d](https://github.com/berkmancenter/lumendatabase/releases/tag/2022.08d) - 2022-08-31
### Fixed
* Fixed double-redaction of senders/principals in defamations.

## [22.08c](https://github.com/berkmancenter/lumendatabase/releases/tag/2022.08c) - 2022-08-30
### Changed
* Started redacting sender and principal names in defamations.
Expand Down
8 changes: 7 additions & 1 deletion app/models/defamation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,16 @@ def auto_redact
InstanceRedactor::EntityNameRedactor.new
]

entity_name = principal&.name || sender&.name

# Some submitters redact on their end using this phrase, let's avoid
# double-redaction
return if entity_name == '[REDACTED]'

instance_redactor = InstanceRedactor.new(
custom_redactors,
{
entity_name: principal&.name || sender&.name
entity_name: entity_name
}
)

Expand Down

0 comments on commit ef769ef

Please sign in to comment.