FIX: do not fallback to flair_url column

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

diff --git a/app/models/group.rb b/app/models/group.rb
index b2d3728..b71906b 100644
--- a/app/models/group.rb
+++ b/app/models/group.rb
@@ -748,7 +748,7 @@ class Group < ActiveRecord::Base
   end
 
   def flair_url
-    flair_icon.presence || flair_upload&.url || self[:flair_url].presence
+    flair_icon.presence || flair_upload&.url
   end
 
   protected
diff --git a/spec/models/group_spec.rb b/spec/models/group_spec.rb
index ddc3224..42e50ce 100644
--- a/spec/models/group_spec.rb
+++ b/spec/models/group_spec.rb
@@ -972,24 +972,6 @@ describe Group do
     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
     before { SiteSetting.unicode_usernames = true }
 

GitHub sha: c011b817

1 Like