#NEWLINE# @ permission_required ( 'core.manage_shop' ) #NEWLINE# def save_voucher_options( request ) : #NEWLINE# #INDENT# 'Saves voucher options.\n    ' #NEWLINE# try : #NEWLINE# #INDENT# voucher_options = VoucherOptions . objects . all ( ) [ 0 ] #NEWLINE# #UNINDENT# except IndexError : #NEWLINE# #INDENT# voucher_options = VoucherOptions . objects . create ( ) #NEWLINE# #UNINDENT# form = VoucherOptionsForm ( instance = voucher_options , data = request . POST ) #NEWLINE# if form . is_valid ( ) : #NEWLINE# #INDENT# form . save ( ) #NEWLINE# #UNINDENT# return render_to_ajax_response ( ( ( '#options_tab' , options_tab ( request ) ) , ) , _ ( 'Voucher options has been saved.' ) )