about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2023-02-10 13:48:21 +0100
committerClaire <claire.github-309c@sitedethib.com>2023-02-10 13:48:21 +0100
commit4ceadc65b08cf4641c68b0b97b269f66c481ef50 (patch)
tree13200192f2b89bb6b4ceae9d1ef7e2ba3b75b1e4 /app/models
parent5e3790608321fa6690a8872681a5618ee9e43475 (diff)
parenta9c220242bcc5f3d5e4c8ea92483f6b626a30ffa (diff)
Merge branch 'main' into glitch-soc/merge-upstream
Diffstat (limited to 'app/models')
-rw-r--r--app/models/account_suggestions/setting_source.rb4
-rw-r--r--app/models/form/admin_settings.rb2
2 files changed, 3 insertions, 3 deletions
diff --git a/app/models/account_suggestions/setting_source.rb b/app/models/account_suggestions/setting_source.rb
index be9eff233..7b8873e0c 100644
--- a/app/models/account_suggestions/setting_source.rb
+++ b/app/models/account_suggestions/setting_source.rb
@@ -54,7 +54,7 @@ class AccountSuggestions::SettingSource < AccountSuggestions::Source
 
       next if username.blank?
 
-      [username, domain]
+      [username.downcase, domain&.downcase]
     end.compact
   end
 
@@ -63,6 +63,6 @@ class AccountSuggestions::SettingSource < AccountSuggestions::Source
   end
 
   def to_ordered_list_key(account)
-    [account.username, account.domain]
+    [account.username.downcase, account.domain&.downcase]
   end
 end
diff --git a/app/models/form/admin_settings.rb b/app/models/form/admin_settings.rb
index 6b468e3ea..62a96528d 100644
--- a/app/models/form/admin_settings.rb
+++ b/app/models/form/admin_settings.rb
@@ -86,7 +86,7 @@ class Form::AdminSettings
   validates :show_domain_blocks_rationale, inclusion: { in: %w(disabled users all) }, if: -> { defined?(@show_domain_blocks_rationale) }
   validates :media_cache_retention_period, :content_cache_retention_period, :backups_retention_period, numericality: { only_integer: true }, allow_blank: true, if: -> { defined?(@media_cache_retention_period) || defined?(@content_cache_retention_period) || defined?(@backups_retention_period) }
   validates :site_short_description, length: { maximum: 200 }, if: -> { defined?(@site_short_description) }
-  validates :status_page_url, url: true
+  validates :status_page_url, url: true, allow_blank: true
   validate :validate_site_uploads
 
   KEYS.each do |key|