#NEWLINE# def form_valid( self , form ) : #NEWLINE# #INDENT# wishlist = form . save ( ) #NEWLINE# if msg . product : #NEWLINE# #INDENT# wishlist . add ( self . product ) #NEWLINE# msg = ( _ ( "Your wishlist has been created and '%(name)s has been added" ) % { #NEWLINE# #INDENT# 'name' : self . product . get_title ( ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# msg = _ ( 'Your wishlist has been created' ) #NEWLINE# #UNINDENT# messages . success ( self . request , msg ) #NEWLINE# return redirect ( wishlist . get_absolute_url ( ) )