@login_required
@require_POST
def save_zen(request, project, subproject, lang):
 translation = get_translation(request, project, subproject, lang)
 user_locked = translation.is_user_locked(request.user)
 form = TranslationForm(translation, None, request.POST)
 if (not can_translate(request.user, translation)):
  messages.error(request, _(u"You don't have privileges to save translations!"))
 elif (not form.is_valid()):
  messages.error(request, _(u'Failed to save translation!'))
 elif (not user_locked):
  unit = form.cleaned_data[u'unit']
  perform_translation(unit, form, request)
 return render(request, u'zen-response.html', {})

@ login_required @ require_POST def save_zen ( request , project , subproject , lang ) : translation = get_translation ( request , project , subproject , lang ) user_locked = translation . is_user_locked ( request . user ) form = TranslationForm ( translation , None , request . POST ) if ( not can_translate ( request . user , translation ) ) : messages . error ( request , _ ( u"You don't have privileges to save translations!" ) ) elif ( not form . is_valid ( ) ) : messages . error ( request , _ ( u'Failed to save translation!' ) ) elif ( not user_locked ) : unit = form . cleaned_data [ u'unit' ] perform_translation ( unit , form , request ) return render ( request , u'zen-response.html' , { } )
save handler for zen mode .