diff --git a/accounts/templates/profile.html b/accounts/templates/profile.html index 28503ff..b8c7b1c 100644 --- a/accounts/templates/profile.html +++ b/accounts/templates/profile.html @@ -95,20 +95,20 @@ {% endif %}
{% csrf_token %}
- +
- +
- +
diff --git a/accounts/templatetags/tags_fingerprint.py b/accounts/templatetags/tags_fingerprint.py index 5688039..31f3952 100644 --- a/accounts/templatetags/tags_fingerprint.py +++ b/accounts/templatetags/tags_fingerprint.py @@ -7,6 +7,9 @@ register = template.Library() @register.simple_tag def ssh_to_fingerprint(line): - key = base64.b64decode(line.strip().split()[1].encode('ascii')) - fp_plain = hashlib.md5(key).hexdigest() - return ':'.join(a + b for a, b in zip(fp_plain[::2], fp_plain[1::2])) + try: + key = base64.b64decode(line.strip().split()[1].encode('ascii')) + fp_plain = hashlib.md5(key).hexdigest() + return ':'.join(a + b for a, b in zip(fp_plain[::2], fp_plain[1::2])) + except Exception: + return 'Invalid key'