#NEWLINE# def get( self , request , * args , **kwargs ) : #NEWLINE# #INDENT# if ( not request . basket . is_shipping_required ( ) ) : #NEWLINE# #INDENT# self . checkout_session . use_shipping_method ( NoShippingRequired ( ) . code ) #NEWLINE# return self . get_success_response ( ) #NEWLINE# #UNINDENT# if ( not self . checkout_session . is_shipping_address_set ( ) ) : #NEWLINE# #INDENT# messages . error ( request , _ ( 'Please choose a shipping address' ) ) #NEWLINE# return redirect ( 'checkout:shipping-address' ) #NEWLINE# #UNINDENT# self . _methods = self . get_available_shipping_methods ( ) #NEWLINE# if ( len ( self . _methods ) == 0 ) : #NEWLINE# #INDENT# messages . warning ( request , _ ( 'Shipping is unavailable for your chosen address - please choose another' ) ) #NEWLINE# return redirect ( 'checkout:shipping-address' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( len ( self . _methods ) == 1 ) : #NEWLINE# #INDENT# self . checkout_session . use_shipping_method ( self . _methods [ 0 ] . code ) #NEWLINE# return self . get_success_response ( ) #NEWLINE# #UNINDENT# #UNINDENT# return super ( ShippingMethodView , self ) . get ( request , * args , ** args )