diff --git a/app/models/account.rb b/app/models/account.rb index ec49d9308..a26276b9b 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -78,7 +78,7 @@ class Account < ApplicationRecord validates :username, format: { with: /\A#{USERNAME_RE}\z/i }, if: -> { !local? && will_save_change_to_username? } # Local user validations - validates :username, format: { with: /\A[a-z0-9_]+\z/i }, length: { maximum: 30 }, if: -> { local? && will_save_change_to_username? } + validates :username, format: { with: /\A[a-z0-9_]+\z/i }, length: { maximum: 66 }, if: -> { local? && will_save_change_to_username? } validates_with UniqueUsernameValidator, if: -> { local? && will_save_change_to_username? } validates_with UnreservedUsernameValidator, if: -> { local? && will_save_change_to_username? } validates :display_name, length: { maximum: MAX_DISPLAY_NAME_LENGTH }, if: -> { local? && will_save_change_to_display_name? } @@ -388,7 +388,7 @@ class Account < ApplicationRecord def string_limit if account.local? - 255 + 666 else 2047 end diff --git a/app/models/account_identity_proof.rb b/app/models/account_identity_proof.rb index 10b66cccf..ccd54cedc 100644 --- a/app/models/account_identity_proof.rb +++ b/app/models/account_identity_proof.rb @@ -18,7 +18,7 @@ class AccountIdentityProof < ApplicationRecord belongs_to :account validates :provider, inclusion: { in: ProofProvider::SUPPORTED_PROVIDERS } - validates :provider_username, format: { with: /\A[a-z0-9_]+\z/i }, length: { minimum: 2, maximum: 30 } + validates :provider_username, format: { with: /\A[a-z0-9_]+\z/i }, length: { minimum: 2, maximum: 66 } validates :provider_username, uniqueness: { scope: [:account_id, :provider] } validates :token, format: { with: /\A[a-f0-9]+\z/ }, length: { maximum: 66 } diff --git a/app/models/account_moderation_note.rb b/app/models/account_moderation_note.rb index 22e312bb2..c4aca7b5f 100644 --- a/app/models/account_moderation_note.rb +++ b/app/models/account_moderation_note.rb @@ -17,5 +17,5 @@ class AccountModerationNote < ApplicationRecord scope :latest, -> { reorder('created_at DESC') } - validates :content, presence: true, length: { maximum: 500 } + validates :content, presence: true, length: { maximum: 6666 } end diff --git a/app/models/report.rb b/app/models/report.rb index 86c303798..fe825759a 100644 --- a/app/models/report.rb +++ b/app/models/report.rb @@ -27,7 +27,7 @@ class Report < ApplicationRecord scope :unresolved, -> { where(action_taken: false) } scope :resolved, -> { where(action_taken: true) } - validates :comment, length: { maximum: 1000 } + validates :comment, length: { maximum: 6666 } def local? false # Force uri_for to use uri attribute diff --git a/app/models/report_note.rb b/app/models/report_note.rb index 6d7167e0e..e1a3c0768 100644 --- a/app/models/report_note.rb +++ b/app/models/report_note.rb @@ -17,5 +17,5 @@ class ReportNote < ApplicationRecord scope :latest, -> { reorder(created_at: :desc) } - validates :content, presence: true, length: { maximum: 500 } + validates :content, presence: true, length: { maximum: 6666 } end