@block_user_agents
@require_POST
@login_required
@process_document_path
def subscribe_to_tree(request, document_slug, document_locale):
 document = get_object_or_404(Document, locale=document_locale, slug=document_slug)
 status = 0
 if EditDocumentInTreeEvent.is_notifying(request.user, document):
  EditDocumentInTreeEvent.stop_notifying(request.user, document)
 else:
  EditDocumentInTreeEvent.notify(request.user, document)
  status = 1
 if request.is_ajax():
  return JsonResponse({'status': status})
 else:
  return redirect(document)

@ block_user_agents @ require_POST @ login_required @ process_document_path def subscribe_to_tree ( request , document_slug , document_locale ) : document = get_object_or_404 ( Document , locale = document_locale , slug = document_slug ) status = 0 if EditDocumentInTreeEvent . is_notifying ( request . user , document ) : EditDocumentInTreeEvent . stop_notifying ( request . user , document ) else : EditDocumentInTreeEvent . notify ( request . user , document ) status = 1 if request . is_ajax ( ) : return JsonResponse ( { 'status' : status } ) else : return redirect ( document )
toggle watching a tree of documents for edits .