@login_required
@require_POST
def mark_ready_for_l10n_revision(request, document_slug, revision_id):
 revision = get_object_or_404(Revision, pk=revision_id, document__slug=document_slug)
 if (not revision.document.allows(request.user, 'mark_ready_for_l10n')):
  raise PermissionDenied
 if revision.can_be_readied_for_localization():
  revision.is_ready_for_localization = True
  revision.readied_for_localization = datetime.now()
  revision.readied_for_localization_by = request.user
  revision.save()
  ReadyRevisionEvent(revision).fire(exclude=request.user)
  return HttpResponse(json.dumps({'message': revision_id}))
 return HttpResponseBadRequest()

@ login_required @ require_POST def mark_ready_for_l10n_revision ( request , document_slug , revision_id ) : revision = get_object_or_404 ( Revision , pk = revision_id , document__slug = document_slug ) if ( not revision . document . allows ( request . user , 'mark_ready_for_l10n' ) ) : raise PermissionDenied if revision . can_be_readied_for_localization ( ) : revision . is_ready_for_localization = True revision . readied_for_localization = datetime . now ( ) revision . readied_for_localization_by = request . user revision . save ( ) ReadyRevisionEvent ( revision ) . fire ( exclude = request . user ) return HttpResponse ( json . dumps ( { 'message' : revision_id } ) ) return HttpResponseBadRequest ( )
mark a revision as ready for l10n .