diff --git a/ietf/person/models.py b/ietf/person/models.py index 7b85e6c36..81ac423fc 100644 --- a/ietf/person/models.py +++ b/ietf/person/models.py @@ -387,9 +387,9 @@ class PersonalApiKey(models.Model): assert isinstance(s, bytes) try: key = base64.urlsafe_b64decode(s) + id, salt, hash = struct.unpack(KEY_STRUCT, key) except Exception: return None - id, salt, hash = struct.unpack(KEY_STRUCT, key) k = cls.objects.filter(id=id) if not k.exists(): return None