Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When having whitespace in OSM username "user" is shown instead of actual name #3140

Open
hholzgra opened this issue Aug 14, 2022 · 2 comments

Comments

@hholzgra
Copy link

My OpenStreetMap username / login is "Hartmut Holzgraefe" with a space between first and last name.

When I log in via the OpenStreetMap provider {{user.username}} and {% user_display.user %} in templates get replaced with the fixed sting user instead of my real user name.

When I log in using a test user account with no whitespace in it I get the actual login name replaced as expected.

There is nothing in the OpenStreetMap provider that would explain this as far as I can tell, so the problem seems to be within allauth itself?

@iarp
Copy link
Contributor

iarp commented Oct 1, 2022

What does the User table itself have for the username value?

@pennersr
Copy link
Owner

pennersr commented Jul 5, 2023

This is due to:

>>> from allauth.account.adapter import get_adapter
>>> get_adapter().clean_username("a b")Traceback (most recent call last):
  File "<console>", line 1, in <module>
django.core.exceptions.ValidationError: ['Enter a valid username. This value may contain only letters, numbers, and @/./+/-/_ characters.']
>>> 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants