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

Check for UserConfig instance during user login #9741

Closed
jeremystretch opened this issue Jul 15, 2022 · 0 comments
Closed

Check for UserConfig instance during user login #9741

jeremystretch opened this issue Jul 15, 2022 · 0 comments
Assignees
Labels
status: accepted This issue has been accepted for implementation type: housekeeping Changes to the application which do not directly impact the end user

Comments

@jeremystretch
Copy link
Member

jeremystretch commented Jul 15, 2022

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.

@jeremystretch jeremystretch added type: housekeeping Changes to the application which do not directly impact the end user status: accepted This issue has been accepted for implementation labels Jul 15, 2022
@jeremystretch jeremystretch self-assigned this Jul 15, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: housekeeping Changes to the application which do not directly impact the end user
Projects
None yet
Development

No branches or pull requests

1 participant