Add support for unicode usernames

Add support for unicode usernames

diff --git a/plugin.rb b/plugin.rb
index 20ccb15..f7196a3 100644
--- a/plugin.rb
+++ b/plugin.rb
@@ -19,8 +19,8 @@ load File.expand_path('../lib/discourse_assign/helpers.rb', __FILE__)
 
 Discourse::Application.routes.append do
   mount ::DiscourseAssign::Engine, at: "/assign"
-  get "topics/private-messages-assigned/:username" => "list#private_messages_assigned", as: "topics_private_messages_assigned", constraints: { username: /[\w.\-]+?/ }
-  get "topics/messages-assigned/:username" => "list#messages_assigned", as: "topics_messages_assigned", constraints: { username: /[\w.\-]+?/ }
+  get "topics/private-messages-assigned/:username" => "list#private_messages_assigned", as: "topics_private_messages_assigned", constraints: { username: ::RouteFormat.username }
+  get "topics/messages-assigned/:username" => "list#messages_assigned", as: "topics_messages_assigned", constraints: { username: ::RouteFormat.username }
 end
 
 # TODO: Remove this once 2.4.0.beta3 is released.

GitHub sha: e96e67bf

2 Likes