<s> from django . views . generic import RedirectView <EOL> from ... import settings <EOL> class StripeProcessorRedirectView ( RedirectView ) : <EOL> """<STR_LIT>""" <EOL> slug_url_kwarg = '<STR_LIT>' <EOL> query_string = True <EOL> def get_redirect_url ( self , * args , ** kwargs ) : <EOL> if settings . PROCESSOR_REDIRECT_CALLABLE : <EOL> from saas . compat import import_string <EOL> func = import_string ( settings . PROCESSOR_REDIRECT_CALLABLE ) <EOL> url = func ( self . request , site = kwargs . get ( self . slug_url_kwarg ) ) <EOL> args = self . request . META . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> if args and self . query_string : <EOL> url = "<STR_LIT>" % ( url , args ) <EOL> else : <EOL> url = super ( StripeProcessorRedirectView , self ) . get_redirect_url ( <EOL> * args , ** kwargs ) <EOL> return url <EOL> def get ( self , request , * args , ** kwargs ) : <EOL> self . permanent = False <EOL> provider = request . GET . get ( '<STR_LIT:state>' , None ) <EOL> kwargs . update ( { self . slug_url_kwarg : provider } ) <EOL> return super ( StripeProcessorRedirectView , self ) . get ( <EOL> request , * args , ** kwargs ) </s>
