Merge pull request #3644 from betagouv/fix-3641
[Fix #3641] Do not change PJ value in API if PJ is safe
This commit is contained in:
commit
a1156c8c41
2 changed files with 2 additions and 2 deletions
|
@ -49,7 +49,7 @@ class Champs::PieceJustificativeChamp < Champ
|
||||||
end
|
end
|
||||||
|
|
||||||
def for_api
|
def for_api
|
||||||
if piece_justificative_file.attached? && virus_scan&.safe?
|
if piece_justificative_file.attached? && (virus_scan&.safe? || virus_scan&.pending?)
|
||||||
Rails.application.routes.url_helpers.url_for(piece_justificative_file)
|
Rails.application.routes.url_helpers.url_for(piece_justificative_file)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -13,7 +13,7 @@ describe Champs::PieceJustificativeChamp do
|
||||||
|
|
||||||
context 'when file is not scanned' do
|
context 'when file is not scanned' do
|
||||||
let(:status) { 'pending' }
|
let(:status) { 'pending' }
|
||||||
it { is_expected.to be_nil }
|
it { is_expected.to include("/rails/active_storage/blobs/") }
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when file is infected' do
|
context 'when file is infected' do
|
||||||
|
|
Loading…
Add table
Reference in a new issue