api token page - server error if user is not selected in dropdown box ( should be a required field ) #8446

Closed
opened 2025-12-29 20:36:51 +01:00 by adam · 0 comments
Owner

Originally created by @ITJamie on GitHub (Aug 10, 2023).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

3.6-beta1

Python version

3.10

Steps to Reproduce

on beta.
goto admins > api tokens > add token
change nothing on field (don't select user)
press submit

Expected Behavior

validation error expected (or unable to press submit until user is chosen)

Observed Behavior

server error response

<class 'django.db.utils.IntegrityError'>

null value in column "user_id" of relation "users_token" violates not-null constraint
DETAIL:  Failing row contains (3, 2023-08-10 12:25:39.308525+00, null, fa8d61d6903e2dbd747165228b03e4292f72f38b, t, , null, {}, null).

Python version: 3.10.12
NetBox version: 3.6-beta1
Originally created by @ITJamie on GitHub (Aug 10, 2023). Originally assigned to: @jeremystretch on GitHub. ### NetBox version 3.6-beta1 ### Python version 3.10 ### Steps to Reproduce on beta. goto admins > api tokens > add token change nothing on field (don't select user) press submit ### Expected Behavior validation error expected (or unable to press submit until user is chosen) ### Observed Behavior server error response ``` <class 'django.db.utils.IntegrityError'> null value in column "user_id" of relation "users_token" violates not-null constraint DETAIL: Failing row contains (3, 2023-08-10 12:25:39.308525+00, null, fa8d61d6903e2dbd747165228b03e4292f72f38b, t, , null, {}, null). Python version: 3.10.12 NetBox version: 3.6-beta1 ```
adam added the type: bugstatus: acceptedbeta labels 2025-12-29 20:36:51 +01:00
adam closed this issue 2025-12-29 20:36:52 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8446