Commit f7350538 authored by Michal Čihař's avatar Michal Čihař

Redirect debugging

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 6e41db00
...@@ -83,6 +83,7 @@ def search(translation, request): ...@@ -83,6 +83,7 @@ def search(translation, request):
# Check if we know the search # Check if we know the search
if search_id not in request.session: if search_id not in request.session:
messages.error(request, _('Invalid search string!')) messages.error(request, _('Invalid search string!'))
print 'Invalid search string!'
return redirect(translation) return redirect(translation)
return request.session[search_id] return request.session[search_id]
...@@ -130,6 +131,7 @@ def search(translation, request): ...@@ -130,6 +131,7 @@ def search(translation, request):
# Check empty search results # Check empty search results
if len(unit_ids) == 0: if len(unit_ids) == 0:
messages.warning(request, _('No string matched your search!')) messages.warning(request, _('No string matched your search!'))
print 'No string matched your search!'
return redirect(translation) return redirect(translation)
# Checksum unit access # Checksum unit access
...@@ -140,6 +142,7 @@ def search(translation, request): ...@@ -140,6 +142,7 @@ def search(translation, request):
offset = unit_ids.index(unit.id) offset = unit_ids.index(unit.id)
except (Unit.DoesNotExist, IndexError): except (Unit.DoesNotExist, IndexError):
messages.warning(request, _('No string matched your search!')) messages.warning(request, _('No string matched your search!'))
print 'No string matched your search!'
return redirect(translation) return redirect(translation)
# Remove old search results # Remove old search results
...@@ -488,6 +491,7 @@ def translate(request, project, subproject, lang): ...@@ -488,6 +491,7 @@ def translate(request, project, subproject, lang):
# Delete search # Delete search
del request.session['search_%s' % search_result['search_id']] del request.session['search_%s' % search_result['search_id']]
# Redirect to translation # Redirect to translation
print 'You have reached end of translating.'
return redirect(translation) return redirect(translation)
# Some URLs we will most likely use # Some URLs we will most likely use
...@@ -539,6 +543,7 @@ def translate(request, project, subproject, lang): ...@@ -539,6 +543,7 @@ def translate(request, project, subproject, lang):
except Unit.DoesNotExist: except Unit.DoesNotExist:
# Can happen when using SID for other translation # Can happen when using SID for other translation
messages.error(request, _('Invalid search string!')) messages.error(request, _('Invalid search string!'))
print 'Invalid search string!'
return redirect(translation) return redirect(translation)
# Show secondary languages for logged in users # Show secondary languages for logged in users
......
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