diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 412e2cd84..801791a4c 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -59,8 +59,7 @@ class UsersController < ApplicationController @user.touch(:profile_updated_at) redirect_to "/settings/#{@tab}" else - Honeycomb.add_field("error", - @user.errors.messages.reject { |_, v| v.empty? }) + Honeycomb.add_field("error", @user.errors.messages.reject { |_, v| v.empty? }) Honeycomb.add_field("errored", true) render :edit, status: :bad_request end diff --git a/app/lib/url.rb b/app/lib/url.rb index e106c702f..bd7d4d011 100644 --- a/app/lib/url.rb +++ b/app/lib/url.rb @@ -60,6 +60,8 @@ module URL # @param user [User] the user to create the URL for def self.user(user) url(user.username) + rescue URI::InvalidURIError # invalid username containing spaces will result in an error + nil end def self.organization(organization) diff --git a/app/views/users/_profile.html.erb b/app/views/users/_profile.html.erb index ec66b896b..56d588471 100644 --- a/app/views/users/_profile.html.erb +++ b/app/views/users/_profile.html.erb @@ -4,7 +4,7 @@
Add the <%= community_name %> badge to your personal site. Click here for the code.
diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb index f17b6b64f..0e6e93c26 100644 --- a/app/views/users/edit.html.erb +++ b/app/views/users/edit.html.erb @@ -49,7 +49,7 @@ <% else %>