]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/user_controller.rb
Allow a user's email address to be marked invalid, and suppress most
[rails.git] / app / controllers / user_controller.rb
index fd58145c47db8fcda56353fc0ff224361e9f9431..35b88b65a97f4580840dd4b9aaa4adae5867a13c 100644 (file)
@@ -14,7 +14,8 @@ class UserController < ApplicationController
     @user = User.new(params[:user])
 
     @user.data_public = true
-      
+    @user.description = "" if @user.description.nil?
+
     if @user.save
       token = @user.tokens.create
       flash[:notice] = "User was successfully created. Check your email for a confirmation note, and you\'ll be mapping in no time :-)<br>Please note that you won't be able to login until you've received and confirmed your email address."
@@ -91,6 +92,7 @@ class UserController < ApplicationController
         user.pass_crypt = pass
         user.pass_crypt_confirmation = pass
         user.active = true
+        user.email_valid = true
         user.save!
         token.destroy
         Notifier::deliver_reset_password(user, pass)
@@ -150,6 +152,7 @@ class UserController < ApplicationController
       if token and !token.user.active?
         @user = token.user
         @user.active = true
+        @user.email_valid = true
         @user.save!
         token.destroy
         flash[:notice] = 'Confirmed your account, thanks for signing up!'