#930 ✓resolved
Tim Griffin

do_accept_invitation should check errors.size before displaying flash

Reported by Tim Griffin | March 15th, 2011 @ 07:58 PM

The default UsersController#do_accept_invitation should check that there are no errors on 'this' before setting the flash notice. If, for example, a save operation on the user fails (such as when the supplied password does not meet the minimum length), we don't want to see the flash notice as well as the error notice.

Should be:

  def do_accept_invitation
    do_transition_action :accept_invitation do
      self.current_user = this     
      if 0 == this.errors.size
        flash[:notice] = t("hobo.messages.you_signed_up", 
             :default=>"Your account has been activated.")
      end
    end
  end

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

People watching this ticket

Referenced by

Pages