|
|
@@ -524,6 +524,7 @@ def edit_coordinator(request):
|
|
|
workflows = [dict([('uuid', d.uuid), ('name', d.name)])
|
|
|
for d in Document2.objects.documents(request.user, include_managed=False).search_documents(types=['oozie-workflow2'])]
|
|
|
|
|
|
+ can_edit_json = doc is None or (doc.can_write(request.user) if USE_NEW_EDITOR.get() else doc.doc.get().is_editable(request.user))
|
|
|
if request.GET.get('format') == 'json': # For Editor
|
|
|
return JsonResponse({
|
|
|
'coordinator': coordinator.get_data_for_json(),
|
|
|
@@ -541,7 +542,7 @@ def edit_coordinator(request):
|
|
|
'workflows_json': json.dumps(workflows, cls=JSONEncoderForHTML),
|
|
|
'doc_uuid': doc.uuid if doc else '',
|
|
|
'is_embeddable': request.GET.get('is_embeddable', False),
|
|
|
- 'can_edit_json': json.dumps(doc is None or doc.doc.get().is_editable(request.user))
|
|
|
+ 'can_edit_json': can_edit_json
|
|
|
})
|
|
|
|
|
|
|
|
|
@@ -753,12 +754,13 @@ def edit_bundle(request):
|
|
|
coordinators = [dict([('id', d.content_object.id), ('uuid', d.content_object.uuid), ('name', d.content_object.name)])
|
|
|
for d in Document.objects.get_docs(request.user, Document2, extra='coordinator2')]
|
|
|
|
|
|
+ can_edit_json = doc is None or (doc.can_write(request.user) if USE_NEW_EDITOR.get() else doc.doc.get().is_editable(request.user))
|
|
|
return render('editor2/bundle_editor.mako', request, {
|
|
|
'bundle_json': bundle.to_json_for_html(),
|
|
|
'coordinators_json': json.dumps(coordinators, cls=JSONEncoderForHTML),
|
|
|
'doc_uuid': doc.uuid if doc else '',
|
|
|
'is_embeddable': request.GET.get('is_embeddable', False),
|
|
|
- 'can_edit_json': json.dumps(doc is None or doc.doc.get().is_editable(request.user))
|
|
|
+ 'can_edit_json': can_edit_json
|
|
|
})
|
|
|
|
|
|
|