@require_POST
@csrf_protect
def aifile_save(request):
 if (not test_user_authenticated(request)):
  return login(request, next='/cobbler_web/aifile/list', expired=True)
 aifile_name = request.POST.get('aifile_name', None)
 aidata = request.POST.get('aidata', '').replace('\r\n', '\n')
 if (aifile_name is None):
  return HttpResponse('NO AUTOMATIC INSTALLATION FILE NAME SPECIFIED')
 delete1 = request.POST.get('delete1', None)
 delete2 = request.POST.get('delete2', None)
 if (delete1 and delete2):
  remote.remove_autoinstall_template(aifile_name, request.session['token'])
  return HttpResponseRedirect('/cobbler_web/aifile/list')
 else:
  remote.write_autoinstall_template(aifile_name, aidata, request.session['token'])
  return HttpResponseRedirect('/cobbler_web/aifile/list')

@ require_POST @ csrf_protect def aifile_save ( request ) : if ( not test_user_authenticated ( request ) ) : return login ( request , next = '/cobbler_web/aifile/list' , expired = True ) aifile_name = request . POST . get ( 'aifile_name' , None ) aidata = request . POST . get ( 'aidata' , '' ) . replace ( '\r\n' , '\n' ) if ( aifile_name is None ) : return HttpResponse ( 'NO AUTOMATIC INSTALLATION FILE NAME SPECIFIED' ) delete1 = request . POST . get ( 'delete1' , None ) delete2 = request . POST . get ( 'delete2' , None ) if ( delete1 and delete2 ) : remote . remove_autoinstall_template ( aifile_name , request . session [ 'token' ] ) return HttpResponseRedirect ( '/cobbler_web/aifile/list' ) else : remote . write_autoinstall_template ( aifile_name , aidata , request . session [ 'token' ] ) return HttpResponseRedirect ( '/cobbler_web/aifile/list' )
this page processes and saves edits to an automatic os installation file .