Commit 82a97172 authored by Michal Čihař's avatar Michal Čihař

We always fetch unit from search results now

parent 58a372d9
......@@ -326,9 +326,6 @@ def translate(request, project, subproject, lang):
profile = None
antispam = AntispamForm()
secondary = None
unit = None
# Search results
search_result = search(obj, request)
......@@ -410,8 +407,6 @@ def translate(request, project, subproject, lang):
# Redirect to same entry for possible editing
return HttpResponseRedirect(this_unit_url)
# If we failed to get unit above or on no POST
if unit is None:
# Grab actual unit
unit = obj.unit_set.get(pk=search_result['ids'][offset])
......@@ -437,6 +432,8 @@ def translate(request, project, subproject, lang):
targets[lang.target] = 1
res.append(lang)
secondary = res
else:
secondary = None
# Prepare form
form = TranslationForm(initial={
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment