-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Description
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 the post_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.