Commit 54928e54 authored by Michal Čihař's avatar Michal Čihař

Use antispam protection for all actions

parent b1def088
...@@ -243,7 +243,7 @@ def handle_translate(obj, request, user_locked, this_unit_url, next_unit_url): ...@@ -243,7 +243,7 @@ def handle_translate(obj, request, user_locked, this_unit_url, next_unit_url):
''' '''
# Antispam protection # Antispam protection
antispam = AntispamForm(request.POST) antispam = AntispamForm(request.POST)
if not request.user.is_authenticated() and not antispam.is_valid(): if not antispam.is_valid():
# Silently redirect to next entry # Silently redirect to next entry
return HttpResponseRedirect(next_unit_url) return HttpResponseRedirect(next_unit_url)
...@@ -555,9 +555,10 @@ def translate(request, project, subproject, lang): ...@@ -555,9 +555,10 @@ def translate(request, project, subproject, lang):
# Show secondary languages for logged in users # Show secondary languages for logged in users
if request.user.is_authenticated(): if request.user.is_authenticated():
secondary = request.user.get_profile().get_secondary_units(unit) secondary = request.user.get_profile().get_secondary_units(unit)
antispam = None
else: else:
secondary = None secondary = None
# Spam protection
antispam = AntispamForm() antispam = AntispamForm()
# Prepare form # Prepare form
......
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