#NEWLINE# @ permission_required ( 'core.manage_shop' ) #NEWLINE# def add_shipping_method( request , template_name = 'manage/shipping_methods/add_shipping_method.html' ) : #NEWLINE# #INDENT# 'Provides an add form and saves a new shipping method.\n    ' #NEWLINE# if ( request . method == 'POST' ) : #NEWLINE# #INDENT# form = ShippingMethodAddForm ( data = request . POST ) #NEWLINE# if form . is_valid ( ) : #NEWLINE# #INDENT# new_shipping_method = form . save ( ) #NEWLINE# return lfs . core . utils . set_message_cookie ( url = reverse ( 'lfs_manage_shipping_method' , kwargs = { #NEWLINE# #INDENT# 'shipping_method_id' : new_shipping_method . id , #NEWLINE# #UNINDENT# } ) , msg = _ ( 'Shipping method has been added.' ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# form = ShippingMethodAddForm ( ) #NEWLINE# #UNINDENT# return render_to_response ( template_name , RequestContext ( request , { #NEWLINE# #INDENT# 'form' : form , #NEWLINE# 'came_from' : ( request . POST if ( request . method == 'POST' ) else request . GET ) . get ( 'came_from' , reverse ( 'lfs_manage_shipping' ) ) , #NEWLINE# #UNINDENT# } ) )