Fix dismissing an announcement twice raising an obscure error (#13124)

remotes/1727458204337373841/tmp_refs/heads/signup-info-prompt
ThibG 2020-02-24 22:21:40 +01:00 committed by GitHub
parent cf4fe6caef
commit 7face973fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -11,7 +11,7 @@ class Api::V1::AnnouncementsController < Api::BaseController
end
def dismiss
AnnouncementMute.create!(account: current_account, announcement: @announcement)
AnnouncementMute.find_or_create_by!(account: current_account, announcement: @announcement)
render_empty
end