mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Make allow_uploaded_avatars accept TL (#14091)
This gives admins more control over who can upload custom profile pictures.
This commit is contained in:
19
db/migrate/20210819152920_change_allow_uploaded_avatars.rb
Normal file
19
db/migrate/20210819152920_change_allow_uploaded_avatars.rb
Normal file
@@ -0,0 +1,19 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class ChangeAllowUploadedAvatars < ActiveRecord::Migration[6.1]
|
||||
def up
|
||||
execute <<~SQL
|
||||
UPDATE site_settings
|
||||
SET data_type = 7, value = (CASE WHEN value = 'f' THEN 'disabled' ELSE '0' END)
|
||||
WHERE name = 'allow_uploaded_avatars'
|
||||
SQL
|
||||
end
|
||||
|
||||
def down
|
||||
execute <<~SQL
|
||||
UPDATE site_settings
|
||||
SET data_type = 5, value = (CASE WHEN value = 'disabled' THEN 'f' ELSE 't' END)
|
||||
WHERE name = 'allow_uploaded_avatars'
|
||||
SQL
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user