about summary refs log tree commit diff
path: root/app/models/account.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/account.rb')
-rw-r--r--app/models/account.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/account.rb b/app/models/account.rb
index 851ce1fd6..f4631e938 100644
--- a/app/models/account.rb
+++ b/app/models/account.rb
@@ -88,8 +88,8 @@ class Account < ApplicationRecord
   validates :username, presence: true
   validates_with UniqueUsernameValidator, if: -> { will_save_change_to_username? }
 
-  # Remote user validations
-  validates :username, format: { with: USERNAME_ONLY_RE }, if: -> { !local? && will_save_change_to_username? }
+  # Remote user validations, also applies to internal actors
+  validates :username, format: { with: USERNAME_ONLY_RE }, if: -> { (!local? || actor_type == 'Application') && 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? && actor_type != 'Application' }