@check_dataset_access_permission
@check_dataset_edition_permission()
def edit_coordinator_dataset(request, dataset):
 response = {'status': (-1), 'data': 'None'}
 if (request.method == 'POST'):
  dataset_form = DatasetForm(request.POST, instance=dataset, prefix='edit')
  if dataset_form.is_valid():
   dataset = dataset_form.save()
   response['status'] = 0
   response['data'] = (reverse('oozie:edit_coordinator', kwargs={'coordinator': dataset.coordinator.id}) + '#listDataset')
   request.info(_('Dataset modified'))
   if (dataset.start > dataset.coordinator.start):
    request.warn(_('Beware: dataset start date was after the coordinator start date.'))
  else:
   response['data'] = dataset_form.errors
 else:
  dataset_form = DatasetForm(instance=dataset, prefix='edit')
 if (response['status'] != 0):
  response['data'] = render('editor/edit_coordinator_dataset.mako', request, {'coordinator': dataset.coordinator, 'dataset_form': dataset_form, 'dataset': dataset, 'path': request.path}, force_template=True).content
 return JsonResponse(response, safe=False)

@ check_dataset_access_permission @ check_dataset_edition_permission ( ) def edit_coordinator_dataset ( request , dataset ) : response = { 'status' : ( - 1 ) , 'data' : 'None' } if ( request . method == 'POST' ) : dataset_form = DatasetForm ( request . POST , instance = dataset , prefix = 'edit' ) if dataset_form . is_valid ( ) : dataset = dataset_form . save ( ) response [ 'status' ] = 0 response [ 'data' ] = ( reverse ( 'oozie:edit_coordinator' , kwargs = { 'coordinator' : dataset . coordinator . id } ) + '#listDataset' ) request . info ( _ ( 'Dataset modified' ) ) if ( dataset . start > dataset . coordinator . start ) : request . warn ( _ ( 'Beware: dataset start date was after the coordinator start date.' ) ) else : response [ 'data' ] = dataset_form . errors else : dataset_form = DatasetForm ( instance = dataset , prefix = 'edit' ) if ( response [ 'status' ] != 0 ) : response [ 'data' ] = render ( 'editor/edit_coordinator_dataset.mako' , request , { 'coordinator' : dataset . coordinator , 'dataset_form' : dataset_form , 'dataset' : dataset , 'path' : request . path } , force_template = True ) . content return JsonResponse ( response , safe = False )
returns html for modal to edit datasets .