Remove checks with removing list related to antenna

This commit is contained in:
KMY 2023-08-21 12:23:42 +09:00
parent 86c63d2dbb
commit b65a022ac3
3 changed files with 2 additions and 3 deletions

View file

@ -31,7 +31,8 @@ class Api::V1::ListsController < Api::BaseController
end end
def destroy def destroy
raise Mastodon::ValidationError, I18n.t('antennas.errors.remove_list_with_antenna') if Antenna.where(list_id: @list.id).any? antenna = Antenna.find_by(list_id: @list.id)
antenna.update!(list_id: 0) if antenna.present?
@list.destroy! @list.destroy!
render_empty render_empty

View file

@ -1063,7 +1063,6 @@ en:
invalid_list_owner: This list is not yours invalid_list_owner: This list is not yours
over_limit: You have exceeded the limit of %{limit} antennas over_limit: You have exceeded the limit of %{limit} antennas
over_stl_limit: You have exceeded the limit of %{limit} stl antennas over_stl_limit: You have exceeded the limit of %{limit} stl antennas
remove_list_with_antenna: Cannot remove list because this list is related to antenna.
index: index:
contexts: Antennas in %{contexts} contexts: Antennas in %{contexts}
delete: Delete delete: Delete

View file

@ -1034,7 +1034,6 @@ ja:
tags: 登録できるタグ数の上限に達しています tags: 登録できるタグ数の上限に達しています
over_limit: 所持できるアンテナ数 %{limit}を超えています over_limit: 所持できるアンテナ数 %{limit}を超えています
over_stl_limit: 所持できるSTLモード付きアンテナ数 (ホーム/リストそれぞれにつき%{limit}) を超えています over_stl_limit: 所持できるSTLモード付きアンテナ数 (ホーム/リストそれぞれにつき%{limit}) を超えています
remove_list_with_antenna: アンテナが関連付けられているリストは削除できません
edit: edit:
accounts_hint: ローカルアカウントの場合は「@info」、リモートアカウントの場合は「@info@example.com」の形式で指定します。サーバーが認識していないアカウントは保存時に自動的に削除されます。 accounts_hint: ローカルアカウントの場合は「@info」、リモートアカウントの場合は「@info@example.com」の形式で指定します。サーバーが認識していないアカウントは保存時に自動的に削除されます。
accounts_raw: 絞り込むアカウント accounts_raw: 絞り込むアカウント