From a02ded6b0142fb2e056b8f21583b4df61b29d963 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Mon, 19 Aug 2019 11:47:50 -0400 Subject: [PATCH] Import Django User model automatically when running nbshell --- netbox/extras/management/commands/nbshell.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/netbox/extras/management/commands/nbshell.py b/netbox/extras/management/commands/nbshell.py index 18c0d0a0a..9c9c329e3 100644 --- a/netbox/extras/management/commands/nbshell.py +++ b/netbox/extras/management/commands/nbshell.py @@ -5,6 +5,7 @@ import sys from django import get_version from django.apps import apps from django.conf import settings +from django.contrib.auth.models import User from django.core.management.base import BaseCommand APPS = ['circuits', 'dcim', 'extras', 'ipam', 'secrets', 'tenancy', 'users', 'virtualization'] @@ -50,6 +51,9 @@ class Command(BaseCommand): except KeyError: pass + # Additional objects to include + namespace['User'] = User + # Load convenience commands namespace.update({ 'lsmodels': self._lsmodels,