mirror of
https://github.com/discourse/discourse.git
synced 2025-06-06 23:07:28 +08:00
FIX: do not fallback to flair_url column
flair_url is not loaded by our query anymore so avoid falling back to the old value
This commit is contained in:
@ -748,7 +748,7 @@ class Group < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def flair_url
|
def flair_url
|
||||||
flair_icon.presence || flair_upload&.url || self[:flair_url].presence
|
flair_icon.presence || flair_upload&.url
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
@ -972,24 +972,6 @@ describe Group do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
it "allows Font Awesome 4.7 syntax as group avatar flair" do
|
|
||||||
group = Fabricate(:group)
|
|
||||||
group.flair_url = "fa-air-freshener"
|
|
||||||
group.save
|
|
||||||
|
|
||||||
group = Group.find(group.id)
|
|
||||||
expect(group.flair_url).to eq("fa-air-freshener")
|
|
||||||
end
|
|
||||||
|
|
||||||
it "allows Font Awesome 5 syntax as group avatar flair" do
|
|
||||||
group = Fabricate(:group)
|
|
||||||
group.flair_url = "fab fa-bandcamp"
|
|
||||||
group.save
|
|
||||||
|
|
||||||
group = Group.find(group.id)
|
|
||||||
expect(group.flair_url).to eq("fab fa-bandcamp")
|
|
||||||
end
|
|
||||||
|
|
||||||
context "Unicode usernames and group names" do
|
context "Unicode usernames and group names" do
|
||||||
before { SiteSetting.unicode_usernames = true }
|
before { SiteSetting.unicode_usernames = true }
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user