[1.8.x] Fixed #24334 -- Allowed admin password reset to work with non-digit...
[1.8.x] Fixed #24334 -- Allowed admin password reset to work with non-digit custom user model primary key.
Thanks Loic for help and Simon for review.
Backport of fdf20093 from master