@check_job_access_permission()
@check_job_edition_permission()
def create_coordinator_data(request, coordinator, data_type):
 if (data_type == 'input'):
  data_instance = DataInput(coordinator=coordinator)
  DataForm = DataInputForm
 else:
  data_instance = DataOutput(coordinator=coordinator)
  DataForm = DataOutputForm
 response = {'status': (-1), 'data': 'None'}
 if (request.method == 'POST'):
  data_form = DataForm(request.POST, instance=data_instance, coordinator=coordinator, prefix=data_type)
  if data_form.is_valid():
   data_form.save()
   response['status'] = 0
   response['data'] = reverse('oozie:edit_coordinator', kwargs={'coordinator': coordinator.id})
   request.info(_('Coordinator data created'))
  else:
   response['data'] = data_form.errors
 else:
  response['data'] = _('A POST request is required.')
 return JsonResponse(response)

@ check_job_access_permission ( ) @ check_job_edition_permission ( ) def create_coordinator_data ( request , coordinator , data_type ) : if ( data_type == 'input' ) : data_instance = DataInput ( coordinator = coordinator ) DataForm = DataInputForm else : data_instance = DataOutput ( coordinator = coordinator ) DataForm = DataOutputForm response = { 'status' : ( - 1 ) , 'data' : 'None' } if ( request . method == 'POST' ) : data_form = DataForm ( request . POST , instance = data_instance , coordinator = coordinator , prefix = data_type ) if data_form . is_valid ( ) : data_form . save ( ) response [ 'status' ] = 0 response [ 'data' ] = reverse ( 'oozie:edit_coordinator' , kwargs = { 'coordinator' : coordinator . id } ) request . info ( _ ( 'Coordinator data created' ) ) else : response [ 'data' ] = data_form . errors else : response [ 'data' ] = _ ( 'A POST request is required.' ) return JsonResponse ( response )
returns {status 0/1 .