From 27a91276b97cdf088e577070d0ce3379ba77a67c Mon Sep 17 00:00:00 2001 From: Jay Guo Date: Mon, 15 Dec 2025 19:03:50 -0500 Subject: [PATCH] Fix reset_key generation The reset_key was being stored as the string representation of a bytes string. Instead we should store it as the decoded string. --- ckan/lib/mailer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ckan/lib/mailer.py b/ckan/lib/mailer.py index 485c9d45470..6fb7c497eae 100644 --- a/ckan/lib/mailer.py +++ b/ckan/lib/mailer.py @@ -203,12 +203,12 @@ def send_invite(user, group_dict=None, role=None): def create_reset_key(user): - user.reset_key = text_type(make_key()) + user.reset_key = make_key() model.repo.commit() def make_key(): - return codecs.encode(os.urandom(16), 'hex') + return codecs.encode(os.urandom(16), 'hex').decode() def verify_reset_link(user, key):