summaryrefslogtreecommitdiffstats
path: root/app/models/user.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/user.rb')
-rw-r--r--app/models/user.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 4f8223dc0..32cc08b11 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -81,10 +81,14 @@ class User < ActiveRecord::Base
end
def identity_url=(url)
- begin
- self.write_attribute(:identity_url, OpenIdAuthentication.normalize_identifier(url))
- rescue InvalidOpenId
- # Invlaid url, don't save
+ if url.blank?
+ write_attribute(:identity_url, '')
+ else
+ begin
+ write_attribute(:identity_url, OpenIdAuthentication.normalize_identifier(url))
+ rescue OpenIdAuthentication::InvalidOpenId
+ # Invlaid url, don't save
+ end
end
self.read_attribute(:identity_url)
end