Open aidswidjaja opened 1 year ago
Hi, I would like to work on this. What exactly is expected to be done for this? Should it not fetch username if it is invalid?
Hi @vrii14! Essentially, we use the Django get_username()
method in the form of its Jinja templating equivalent {{ user.get_username}}
. https://docs.djangoproject.com/en/dev/ref/contrib/auth/#django.contrib.auth.models.User.get_username. We extend the default User model with custom validation.
get_username
is called to fetch the currently logged-in user's username and display it in the top-right button as shown in the screenshot in the original issue description (I call this the Magic Button internally).
Ideally, the expected behaviour is that it fetches the currently used validated username. An invalid form submission should not result in the invalidated username being submitted - which is what occurs when checking in Django /admin/. However, for some weird reason, the get_username method returns the invalidated username on my local dev server, at least on that page.
I am not sure if this is an (albeit low priority) bug in the method or my own misapplication of it's attributes. Logic may need to be implemented to work around this.
I have fix it. Please checkout Pull Request #7
get_username()
fetches usernames which have been invalidated. See top-right cornerLow priority and zero impact on services, but good first issue.