<s> """<STR_LIT>""" <EOL> __author__ = '<STR_LIT>' <EOL> __copyright__ = '<STR_LIT>' <EOL> __version__ = '<STR_LIT>' <EOL> from utils import clean_http_referer <EOL> class SetCancelUrlMixin ( object ) : <EOL> """<STR_LIT>""" <EOL> cancel_url = None <EOL> def get_context_data ( self , ** kwargs ) : <EOL> context = super ( SetCancelUrlMixin , self ) . get_context_data ( ** kwargs ) <EOL> context [ '<STR_LIT>' ] = self . request . GET . get ( '<STR_LIT>' , self . cancel_url or clean_http_referer ( self . request ) ) <EOL> return context <EOL> class SetSuccessUrlMixin ( object ) : <EOL> """<STR_LIT>""" <EOL> success_url = None <EOL> def get_context_data ( self , ** kwargs ) : <EOL> context = super ( SetSuccessUrlMixin , self ) . get_context_data ( ** kwargs ) <EOL> context [ '<STR_LIT>' ] = self . request . GET . get ( '<STR_LIT>' , self . success_url or clean_http_referer ( self . request ) ) <EOL> return context <EOL> def get_success_url ( self ) : <EOL> try : <EOL> return self . request . GET . get ( '<STR_LIT>' , self . success_url or clean_http_referer ( self . request ) ) <EOL> except : <EOL> return super ( SetSuccessUrlMixin , self ) . get_success_url ( ) </s>
