Person.find_or_fetch_by_identifier never return nil

Person.find_or_fetch_by_identifier raises an exception if person is not found localy and not fetchable. It never returns nil. These code changes take care about this behaviour and changes specs and code to behave equally.

Close #8273
This commit is contained in:
Thorsten Claus 2021-07-17 17:39:20 +02:00 committed by Benjamin Neff
parent e2b96c81f2
commit cdb50edabc
No known key found for this signature in database
GPG key ID: 971464C3F1A90194

View file

@ -5,12 +5,11 @@ class ArchiveValidator
include Diaspora::Logging
def validate
return if person.nil?
return if person.public_key.export == private_key.public_key.export
messages.push("Private key in the archive doesn't match the known key of #{person.diaspora_handle}")
rescue DiasporaFederation::Discovery::DiscoveryError
logger.info "#{self}: Archive author couldn't be fetched (old home pod is down?), will continue with data"\
logger.info "Archive author couldn't be fetched (old home pod is down?), will continue with data"\
" import only"
end
end