mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 11:20:57 -06:00
FIX: Ensure group flair upload is present when deciding type (#12650)
Previously, if the upload_id was present, but the upload was missing, the entire site would give a server error. We have no foreign keys on this relation, so we have to be able to cope with the situation where the upload_id is present, but the actual upload has been deleted. Co-authored-by: Jarek Radosz <jradosz@gmail.com>
This commit is contained in:
parent
eb7ff576e5
commit
38e7fe2770
@ -747,7 +747,7 @@ class Group < ActiveRecord::Base
|
||||
|
||||
def flair_type
|
||||
return :icon if flair_icon.present?
|
||||
return :image if flair_upload_id.present?
|
||||
return :image if flair_upload.present?
|
||||
end
|
||||
|
||||
def flair_url
|
||||
|
Loading…
Reference in New Issue
Block a user