python-social-auth
python-social-auth copied to clipboard
Documentation gives regex for CLEAN_USERNAMES that isn't the one that's coded
The docs say, in Username generation, that the regex for CLEAN_USERNAME is r'[^\w.@+-_]+', whereas the code has (in social.storage.base)
CLEAN_USERNAME_REGEX = re.compile(r'[^\w.@+_-]+', re.UNICODE)
The documented regex creates an interesting range, viz. '+-_'. The actual Python text puts '-' at the end, which is good; also, it has the re.UNICODE option, which, I think, is worth mentioning in the docs, as it provides guidance when thinking about locales for \w.
Updated https://github.com/python-social-auth/social-docs/commit/551123cc61a545ef79b683592a0931f1a313cca5.