]> cat aescling's git repositories - mastodon.git/commit
Set unknown attachment type when adding domain blocks (#2605)
authorPatrick Figel <patrick@figel.email>
Sat, 29 Apr 2017 00:44:03 +0000 (02:44 +0200)
committerEugen Rochko <eugen@zeonfederated.com>
Sat, 29 Apr 2017 00:44:03 +0000 (02:44 +0200)
commit197af5de70221498f44c60ebfbffd4d4c803dead
treed348fa89a5f20398074f6b72bee2848f02783a8b
parent27301312a698e0fd2d1898d9e1c579d7f9ee861f
Set unknown attachment type when adding domain blocks (#2605)

Follow-up to #2599. When a domain block with `reject_media` is
added or `rake mastodon:media:remove_remote` is invoked, mastodon
deletes the locally cached attachments and avatars but does not
reflect that change in the database, causing the `file` fields to
still have values. This change persists the deletion in the
database and sets the attachment type to unknown.

This also introduces a one-off rake task that sets all attachments
without a local file to the "unknown" type. The upgrade notes for
the next release should contain a post-upgrade step with
`rake mastodon:media:set_unknown`.
app/services/block_domain_service.rb
lib/tasks/mastodon.rake