Don't change the filename of the export everytime the user is touched
closes #7622
This commit is contained in:
parent
ac39e920c8
commit
95fbd3fc66
4 changed files with 13 additions and 5 deletions
|
|
@ -23,6 +23,7 @@
|
||||||
* Display likes and reshares without login [#7583](https://github.com/diaspora/diaspora/pull/7583)
|
* Display likes and reshares without login [#7583](https://github.com/diaspora/diaspora/pull/7583)
|
||||||
* Fix invalid data in the database for user data export [#7614](https://github.com/diaspora/diaspora/pull/7614)
|
* Fix invalid data in the database for user data export [#7614](https://github.com/diaspora/diaspora/pull/7614)
|
||||||
* Fix local migration run without old private key [#7558](https://github.com/diaspora/diaspora/pull/7558)
|
* Fix local migration run without old private key [#7558](https://github.com/diaspora/diaspora/pull/7558)
|
||||||
|
* Fix export not downloadable because the filename was resetted on access [#7622](https://github.com/diaspora/diaspora/pull/7622)
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
* Ask for confirmation when leaving a submittable comment field [#7530](https://github.com/diaspora/diaspora/pull/7530)
|
* Ask for confirmation when leaving a submittable comment field [#7530](https://github.com/diaspora/diaspora/pull/7530)
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@
|
||||||
# the COPYRIGHT file.
|
# the COPYRIGHT file.
|
||||||
|
|
||||||
class ExportedPhotos < SecureUploader
|
class ExportedPhotos < SecureUploader
|
||||||
|
|
||||||
def store_dir
|
def store_dir
|
||||||
"uploads/users"
|
"uploads/users"
|
||||||
end
|
end
|
||||||
|
|
@ -13,7 +12,4 @@ class ExportedPhotos < SecureUploader
|
||||||
def filename
|
def filename
|
||||||
"#{model.username}_photos_#{secure_token}.zip" if original_filename.present?
|
"#{model.username}_photos_#{secure_token}.zip" if original_filename.present?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,6 @@ class ExportedUser < SecureUploader
|
||||||
end
|
end
|
||||||
|
|
||||||
def filename
|
def filename
|
||||||
"#{model.username}_diaspora_data_#{secure_token}.json.gz"
|
"#{model.username}_diaspora_data_#{secure_token}.json.gz" if original_filename.present?
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -981,6 +981,17 @@ describe User, :type => :model do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe "#export" do
|
||||||
|
it "doesn't change the filename when the user is saved" do
|
||||||
|
user = FactoryGirl.create(:user)
|
||||||
|
|
||||||
|
filename = user.export.filename
|
||||||
|
user.save!
|
||||||
|
|
||||||
|
expect(User.find(user.id).export.filename).to eq(filename)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
describe "queue_export" do
|
describe "queue_export" do
|
||||||
it "queues up a job to perform the export" do
|
it "queues up a job to perform the export" do
|
||||||
user = FactoryGirl.create(:user)
|
user = FactoryGirl.create(:user)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue