BUG: Setting AXES_USERNAME_FORM_FIELD
to a custom value fails to fill the username field for AccessAttempt
#1159
Labels
AXES_USERNAME_FORM_FIELD
to a custom value fails to fill the username field for AccessAttempt
#1159
Describe the bug
In our project, we have set the
AXES_USERNAME_FORM_FIELD
to a custom value. When doing this,AccessAttempt
in the database doesn't get a username set, this stays None.After a quick debug, it showed that there is a call being made where the credentials are given. However, in the credentials dict, the username is stored in a field named
username
in stead of the value set inAXES_USERNAME_FORM_FIELD
. Since the code tries to fetch the username based on the name in the settings, this will return None. Assumption for now is that this were it goes wrong.To Reproduce
Steps to reproduce the behavior:
auth-username
)AXES_USERNAME_FORM_FIELD
toauth-username
AccessAttempt
will be empty.Expected behavior
The username field on the
AccessAttempt
model is filled with the correct username.Your environment
python version: 3.8.18
django version: 3.2.23
django-axes version: 6.3.0
Operating system: Mac OS
Additional context
What was interesting was that the credentials that were shown in the debugger was:
username
:username filled in the form
password
:***********************
Possibly this conflicts with the logging implementation.
Possible implementation
Probably an easy bugfix where
username
is used in stead of the value set inAXES_USERNAME_FORM_FIELD
The text was updated successfully, but these errors were encountered: