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:
parent
e2b96c81f2
commit
cdb50edabc
1 changed files with 1 additions and 2 deletions
|
|
@ -5,12 +5,11 @@ class ArchiveValidator
|
||||||
include Diaspora::Logging
|
include Diaspora::Logging
|
||||||
|
|
||||||
def validate
|
def validate
|
||||||
return if person.nil?
|
|
||||||
return if person.public_key.export == private_key.public_key.export
|
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}")
|
messages.push("Private key in the archive doesn't match the known key of #{person.diaspora_handle}")
|
||||||
rescue DiasporaFederation::Discovery::DiscoveryError
|
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"
|
" import only"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue