Check for UserConfig instance during user login #9741
Labels
status: accepted
This issue has been accepted for implementation
type: housekeeping
Changes to the application which do not directly impact the end user
Proposed Changes
Check for the presence of a UserConfig instance after calling
auth_login()
. If a UserConfig instance does not exist for the user, create one.Justification
When a new NetBox user is created, a UserConfig instance gets created automatically by the
create_userconfig()
receiver of thepost_save
signal. However, as discussed in #8718 (specifically this thread) there may be some scenarios where the automatic creation of a UserConfig does not occur for some unknown factor. (The example in question concerns a Docker deployment, but the condition could potentially arise in other cases, such as after an inadvertent deletion.)Although it should not be strictly necessary, adding a sanity check to the login process should avoid an
RelatedObjectDoesNotExist
exception in such a scenario, and allow the user to log in and use NetBox successfully.The text was updated successfully, but these errors were encountered: