#NEWLINE# def get_success_url( self ) : #NEWLINE# #INDENT# '\n        Renders a success message and redirects depending on the button:\n        - Standard case is pressing "Save"; redirects to the product list\n        - When "Save and continue" is pressed, we stay on the same page\n        - When "Create (another) child product" is pressed, it redirects\n          to a new product creation page\n        ' #NEWLINE# msg = render_to_string ( 'dashboard/catalogue/messages/product_saved.html' , { #NEWLINE# #INDENT# 'product' : self . object , #NEWLINE# 'creating' : self . creating , #NEWLINE# 'request' : self . request , #NEWLINE# #UNINDENT# } ) #NEWLINE# messages . success ( self . request , msg , extra_tags = 'safe noicon' ) #NEWLINE# action = self . request . POST . get ( 'action' ) #NEWLINE# if ( action == 'continue' ) : #NEWLINE# #INDENT# url = reverse ( 'dashboard:catalogue-product' , kwargs = { #NEWLINE# #INDENT# 'pk' : self . object . id , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( action == 'create-another-child' ) and self . parent ) : #NEWLINE# #INDENT# url = reverse ( 'dashboard:catalogue-product-create-child' , kwargs = { #NEWLINE# #INDENT# 'parent_pk' : self . parent . pk , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( action == 'create-child' ) : #NEWLINE# #INDENT# url = reverse ( 'dashboard:catalogue-product-create-child' , kwargs = { #NEWLINE# #INDENT# 'parent_pk' : self . object . pk , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# url = reverse ( 'dashboard:catalogue-product-list' ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return self . get_url_with_querystring ( url )