Skip to content

Commit 704f269

Browse files
committed
Merged in [19382] from krathnayake@ietf.org:
Adds ability to hanndle garbage API keys. Fixes ietf-tools#3412. - Legacy-Id: 19386 Note: SVN reference [19382] has been migrated to Git commit 02b8559
2 parents 58fa321 + 02b8559 commit 704f269

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ietf/person/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,9 +387,9 @@ def validate_key(cls, s):
387387
assert isinstance(s, bytes)
388388
try:
389389
key = base64.urlsafe_b64decode(s)
390+
id, salt, hash = struct.unpack(KEY_STRUCT, key)
390391
except Exception:
391392
return None
392-
id, salt, hash = struct.unpack(KEY_STRUCT, key)
393393
k = cls.objects.filter(id=id)
394394
if not k.exists():
395395
return None

0 commit comments

Comments
 (0)