Commit d263609b authored by Weblate's avatar Weblate

Merge remote-tracking branch 'origin/master'

parents 68a2d35c 6bf280c4
......@@ -24,7 +24,6 @@ Simple mathematical captcha.
from __future__ import unicode_literals
import ast
import binascii
from base64 import b64encode, b64decode
import hashlib
import operator
......@@ -166,7 +165,7 @@ def unhash_question(question):
timestamp = question[40:50]
try:
question = b64decode(question[50:]).decode('utf-8')
except (binascii.Error, UnicodeError):
except (TypeError, UnicodeError):
raise ValueError('Invalid encoding')
if hexsha != checksum_question(question, timestamp):
raise ValueError('Tampered question!')
......
......@@ -19,7 +19,7 @@
<td></td>
<td colspan="2" class="translatetext">
{% if not user.profile.hide_source_secondary or not item.secondary %}
{% format_translation item.unit.source item.unit.translation.subproject.project.source_language search_match=search_query num_plurals=unit.translation.language.nplurals %}
{% format_translation item.unit.source item.unit.translation.subproject.project.source_language search_match=search_query num_plurals=item.unit.translation.language.nplurals %}
{% endif %}
{% if item.secondary %}
{% for unit in item.secondary %}
......
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