UserConfig is not being created when pre-creating a account for use with social auth #8959

Closed
opened 2025-12-29 20:43:23 +01:00 by adam · 1 comment
Owner

Originally created by @DanSheps on GitHub (Dec 13, 2023).

Originally assigned to: @DanSheps on GitHub.

Deployment Type

Self-hosted

NetBox Version

v3.6.6

Python Version

3.11

Steps to Reproduce

  1. Connect to a social auth system
  2. Pre-create a user account
  3. Login with user account

Expected Behavior

Login succeeds

Observed Behavior

Exception: User.config.RelatedObjectDoesNotExist

Originally created by @DanSheps on GitHub (Dec 13, 2023). Originally assigned to: @DanSheps on GitHub. ### Deployment Type Self-hosted ### NetBox Version v3.6.6 ### Python Version 3.11 ### Steps to Reproduce 1. Connect to a social auth system 2. Pre-create a user account 3. Login with user account ### Expected Behavior Login succeeds ### Observed Behavior Exception: User.config.RelatedObjectDoesNotExist
adam added the type: bugstatus: acceptedseverity: medium labels 2025-12-29 20:43:23 +01:00
adam closed this issue 2025-12-29 20:43:23 +01:00
Author
Owner

@DanSheps commented on GitHub (Dec 13, 2023):

Root cause is:
b93735861d/netbox/users/models.py (L220)

It was never updated for NetBoxUser model being the primary user model in #12589

A normal login user will hit this codeblock:

b93735861d/netbox/account/views.py (L105-L107)

Simply adding @receiver(post_save, sender=NetBoxUser) in addition to the existing receiver resolves this.

@DanSheps commented on GitHub (Dec 13, 2023): Root cause is: https://github.com/netbox-community/netbox/blob/b93735861d3bde0354c855a8bbd2a2311e8eb920/netbox/users/models.py#L220 It was never updated for NetBoxUser model being the primary user model in #12589 A normal login user will hit this codeblock: https://github.com/netbox-community/netbox/blob/b93735861d3bde0354c855a8bbd2a2311e8eb920/netbox/account/views.py#L105-L107 Simply adding `@receiver(post_save, sender=NetBoxUser)` in addition to the existing receiver resolves this.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8959