Only make a tempfile etc if we're actually going to use it. Keep the body call outside the Chdir block - sometimes getting the body may involve opening files too.
Only make a tempfile etc if we're actually going to use it. Keep the body call outside the Chdir block - sometimes getting the body may involve opening files too.

Conflicts:

    app/models/foi_attachment.rb

andreicristianpetcu/alaveteli,obshtestvo/alaveteli-bulgaria,petterreinholdtsen/alaveteli,Br3nda/alaveteli,Br3nda/alaveteli,TEDICpy/QueremoSaber,nzherald/alaveteli,nzherald/alaveteli,Br3nda/alaveteli,4bic/alaveteli,andreicristianpetcu/alaveteli_old,TEDICpy/QueremoSaber,Br3nda/alaveteli,TEDICpy/QueremoSaber,hasadna/alaveteli,andreicristianpetcu/alaveteli,nzherald/alaveteli,petterreinholdtsen/alaveteli,andreicristianpetcu/alaveteli,TEDICpy/QueremoSaber,4bic/alaveteli,Br3nda/alaveteli,datauy/alaveteli,nzherald/alaveteli,codeforcroatia/alaveteli,datauy/alaveteli,petterreinholdtsen/alaveteli,codeforcroatia/alaveteli,hasadna/alaveteli,obshtestvo/alaveteli-bulgaria,10layer/alaveteli,petterreinholdtsen/alaveteli,datauy/alaveteli,andreicristianpetcu/alaveteli_old,petterreinholdtsen/alaveteli,hasadna/alaveteli,andreicristianpetcu/alaveteli,hasadna/alaveteli,nzherald/alaveteli,4bic/alaveteli,codeforcroatia/alaveteli,andreicristianpetcu/alaveteli_old,TEDICpy/QueremoSaber,andreicristianpetcu/alaveteli,4bic/alaveteli,andreicristianpetcu/alaveteli_old,hasadna/alaveteli,andreicristianpetcu/alaveteli_old,10layer/alaveteli,10layer/alaveteli,4bic/alaveteli,obshtestvo/alaveteli-bulgaria,obshtestvo/alaveteli-bulgaria,obshtestvo/alaveteli-bulgaria,hasadna/alaveteli,codeforcroatia/alaveteli