Actually save translation

This commit is contained in:
Michal Čihař 2012-02-29 11:44:43 +01:00
parent 04666ac331
commit d080b3d0cd

View File

@ -53,8 +53,13 @@ def translate(request, project, subproject, lang):
if request.method == 'POST': if request.method == 'POST':
form = TranslationForm(request.POST) form = TranslationForm(request.POST)
if form.is_valid(): if form.is_valid():
unit = Unit.objects.get(checksum = form.cleaned_data['checksum'], translation = obj)
unit.target = form.cleaned_data['target']
unit.fuzzy = form.cleaned_data['fuzzy']
unit.save_backend(request)
# Check and save # Check and save
return HttpResponseRedirect('%s?type=%s&oldpos=%d' % (obj.get_translate_url(), rqtype, pos)) return HttpResponseRedirect('%s?type=%s&oldpos=%d' % (obj.get_translate_url(), rqtype, pos))
else: else:
# What unit to show # What unit to show