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
-
Domizio Demichelis March 27th, 2011 @ 08:59 PM
- State changed from new to resolved
(from [f9c27705c6330462c3fd225879e7ca988b1b99e7]) accept invitation should set the flash only if this.valid? [#930 state:resolved] https://github.com/tablatom/hobo/commit/f9c27705c6330462c3fd225879e...
-
Domizio Demichelis March 28th, 2011 @ 01:54 AM
(from [c94a26c50ff87f75cb8264e34077cc881a07182e]) restore current_user set removed in f9c2770 [#930] https://github.com/tablatom/hobo/commit/c94a26c50ff87f75cb8264e3407...
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.
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
Tags
Referenced by
- 930 do_accept_invitation should check errors.size before displaying flash (from [f9c27705c6330462c3fd225879e7ca988b1b99e7]) accept ...
- 930 do_accept_invitation should check errors.size before displaying flash (from [c94a26c50ff87f75cb8264e34077cc881a07182e]) restore...