nautobot 2.3.13__py3-none-any.whl → 2.3.15__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of nautobot might be problematic. Click here for more details.
- nautobot/circuits/tables.py +2 -1
- nautobot/core/filters.py +2 -0
- nautobot/core/jobs/cleanup.py +47 -11
- nautobot/core/settings.py +3 -0
- nautobot/core/settings.yaml +8 -0
- nautobot/core/templates/inc/media.html +3 -0
- nautobot/core/templates/nautobot_config.py.j2 +3 -0
- nautobot/core/templates/search.html +7 -0
- nautobot/core/testing/filters.py +20 -5
- nautobot/core/testing/mixins.py +7 -2
- nautobot/core/tests/integration/test_app_home.py +0 -1
- nautobot/core/tests/integration/test_app_navbar.py +0 -1
- nautobot/core/tests/integration/test_filters.py +0 -2
- nautobot/core/tests/integration/test_home.py +0 -1
- nautobot/core/tests/integration/test_navbar.py +0 -1
- nautobot/core/tests/integration/test_view_authentication.py +1 -0
- nautobot/core/tests/test_views.py +29 -0
- nautobot/core/urls.py +9 -0
- nautobot/dcim/forms.py +6 -5
- nautobot/dcim/models/devices.py +1 -0
- nautobot/dcim/tests/test_forms.py +51 -2
- nautobot/extras/forms/mixins.py +11 -3
- nautobot/extras/jobs.py +6 -4
- nautobot/extras/models/customfields.py +12 -11
- nautobot/extras/tests/integration/test_plugin_banner.py +0 -2
- nautobot/extras/tests/test_forms.py +20 -1
- nautobot/ipam/api/views.py +17 -15
- nautobot/ipam/models.py +62 -11
- nautobot/ipam/tables.py +2 -2
- nautobot/ipam/tests/test_api.py +402 -2
- nautobot/ipam/tests/test_models.py +41 -0
- nautobot/project-static/docs/404.html +2 -2
- nautobot/project-static/docs/apps/index.html +2 -2
- nautobot/project-static/docs/apps/nautobot-apps.html +2 -2
- nautobot/project-static/docs/assets/javascripts/{bundle.83f73b43.min.js → bundle.88dd0f4e.min.js} +2 -2
- nautobot/project-static/docs/assets/javascripts/{bundle.83f73b43.min.js.map → bundle.88dd0f4e.min.js.map} +2 -2
- nautobot/project-static/docs/code-reference/nautobot/apps/__init__.html +2 -2
- nautobot/project-static/docs/code-reference/nautobot/apps/admin.html +2 -2
- nautobot/project-static/docs/code-reference/nautobot/apps/api.html +2 -2
- nautobot/project-static/docs/code-reference/nautobot/apps/change_logging.html +2 -2
- nautobot/project-static/docs/code-reference/nautobot/apps/choices.html +2 -2
- nautobot/project-static/docs/code-reference/nautobot/apps/config.html +2 -2
- nautobot/project-static/docs/code-reference/nautobot/apps/constants.html +2 -2
- nautobot/project-static/docs/code-reference/nautobot/apps/datasources.html +2 -2
- nautobot/project-static/docs/code-reference/nautobot/apps/exceptions.html +2 -2
- nautobot/project-static/docs/code-reference/nautobot/apps/factory.html +2 -2
- nautobot/project-static/docs/code-reference/nautobot/apps/filters.html +2 -2
- nautobot/project-static/docs/code-reference/nautobot/apps/forms.html +2 -2
- nautobot/project-static/docs/code-reference/nautobot/apps/graphql.html +2 -2
- nautobot/project-static/docs/code-reference/nautobot/apps/jobs.html +8 -6
- nautobot/project-static/docs/code-reference/nautobot/apps/models.html +2 -2
- nautobot/project-static/docs/code-reference/nautobot/apps/querysets.html +2 -2
- nautobot/project-static/docs/code-reference/nautobot/apps/secrets.html +2 -2
- nautobot/project-static/docs/code-reference/nautobot/apps/tables.html +2 -2
- nautobot/project-static/docs/code-reference/nautobot/apps/testing.html +12 -5
- nautobot/project-static/docs/code-reference/nautobot/apps/ui.html +2 -2
- nautobot/project-static/docs/code-reference/nautobot/apps/urls.html +2 -2
- nautobot/project-static/docs/code-reference/nautobot/apps/utils.html +2 -2
- nautobot/project-static/docs/code-reference/nautobot/apps/views.html +2 -2
- nautobot/project-static/docs/development/apps/api/configuration-view.html +2 -2
- nautobot/project-static/docs/development/apps/api/database-backend-config.html +2 -2
- nautobot/project-static/docs/development/apps/api/models/django-admin.html +2 -2
- nautobot/project-static/docs/development/apps/api/models/global-search.html +2 -2
- nautobot/project-static/docs/development/apps/api/models/graphql.html +2 -2
- nautobot/project-static/docs/development/apps/api/models/index.html +2 -2
- nautobot/project-static/docs/development/apps/api/nautobot-app-config.html +2 -2
- nautobot/project-static/docs/development/apps/api/platform-features/custom-validators.html +2 -2
- nautobot/project-static/docs/development/apps/api/platform-features/filter-extensions.html +2 -2
- nautobot/project-static/docs/development/apps/api/platform-features/git-repository-content.html +2 -2
- nautobot/project-static/docs/development/apps/api/platform-features/index.html +2 -2
- nautobot/project-static/docs/development/apps/api/platform-features/jinja2-filters.html +2 -2
- nautobot/project-static/docs/development/apps/api/platform-features/jobs.html +2 -2
- nautobot/project-static/docs/development/apps/api/platform-features/populating-extensibility-features.html +2 -2
- nautobot/project-static/docs/development/apps/api/platform-features/secrets-providers.html +2 -2
- nautobot/project-static/docs/development/apps/api/platform-features/table-extensions.html +2 -2
- nautobot/project-static/docs/development/apps/api/platform-features/uniquely-identify-objects.html +2 -2
- nautobot/project-static/docs/development/apps/api/prometheus.html +2 -2
- nautobot/project-static/docs/development/apps/api/setup.html +2 -2
- nautobot/project-static/docs/development/apps/api/testing.html +2 -2
- nautobot/project-static/docs/development/apps/api/ui-extensions/banners.html +2 -2
- nautobot/project-static/docs/development/apps/api/ui-extensions/home-page.html +2 -2
- nautobot/project-static/docs/development/apps/api/ui-extensions/index.html +2 -2
- nautobot/project-static/docs/development/apps/api/ui-extensions/navigation.html +2 -2
- nautobot/project-static/docs/development/apps/api/ui-extensions/object-views.html +2 -2
- nautobot/project-static/docs/development/apps/api/views/base-template.html +2 -2
- nautobot/project-static/docs/development/apps/api/views/core-view-overrides.html +2 -2
- nautobot/project-static/docs/development/apps/api/views/django-generic-views.html +2 -2
- nautobot/project-static/docs/development/apps/api/views/help-documentation.html +2 -2
- nautobot/project-static/docs/development/apps/api/views/index.html +2 -2
- nautobot/project-static/docs/development/apps/api/views/nautobot-generic-views.html +2 -2
- nautobot/project-static/docs/development/apps/api/views/nautobotuiviewset.html +2 -2
- nautobot/project-static/docs/development/apps/api/views/nautobotuiviewsetrouter.html +2 -2
- nautobot/project-static/docs/development/apps/api/views/notes.html +2 -2
- nautobot/project-static/docs/development/apps/api/views/rest-api.html +2 -2
- nautobot/project-static/docs/development/apps/api/views/urls.html +2 -2
- nautobot/project-static/docs/development/apps/index.html +2 -2
- nautobot/project-static/docs/development/apps/migration/code-updates.html +2 -2
- nautobot/project-static/docs/development/apps/migration/dependency-updates.html +2 -2
- nautobot/project-static/docs/development/apps/migration/from-v1.html +2 -2
- nautobot/project-static/docs/development/apps/migration/model-updates/dcim.html +2 -2
- nautobot/project-static/docs/development/apps/migration/model-updates/extras.html +2 -2
- nautobot/project-static/docs/development/apps/migration/model-updates/global.html +2 -2
- nautobot/project-static/docs/development/apps/migration/model-updates/ipam.html +2 -2
- nautobot/project-static/docs/development/apps/porting-from-netbox.html +2 -2
- nautobot/project-static/docs/development/core/application-registry.html +2 -2
- nautobot/project-static/docs/development/core/best-practices.html +2 -2
- nautobot/project-static/docs/development/core/bootstrap-ui.html +2 -2
- nautobot/project-static/docs/development/core/caching.html +2 -2
- nautobot/project-static/docs/development/core/controllers.html +2 -2
- nautobot/project-static/docs/development/core/docker-compose-advanced-use-cases.html +27 -70
- nautobot/project-static/docs/development/core/generic-views.html +2 -2
- nautobot/project-static/docs/development/core/getting-started.html +155 -141
- nautobot/project-static/docs/development/core/homepage.html +2 -2
- nautobot/project-static/docs/development/core/index.html +2 -2
- nautobot/project-static/docs/development/core/model-checklist.html +2 -2
- nautobot/project-static/docs/development/core/model-features.html +2 -2
- nautobot/project-static/docs/development/core/natural-keys.html +2 -2
- nautobot/project-static/docs/development/core/navigation-menu.html +2 -2
- nautobot/project-static/docs/development/core/release-checklist.html +2 -2
- nautobot/project-static/docs/development/core/role-internals.html +2 -2
- nautobot/project-static/docs/development/core/settings.html +2 -2
- nautobot/project-static/docs/development/core/style-guide.html +2 -2
- nautobot/project-static/docs/development/core/templates.html +2 -2
- nautobot/project-static/docs/development/core/testing.html +2 -2
- nautobot/project-static/docs/development/core/user-preferences.html +2 -2
- nautobot/project-static/docs/development/index.html +2 -2
- nautobot/project-static/docs/development/jobs/index.html +143 -119
- nautobot/project-static/docs/development/jobs/migration/from-v1.html +2 -2
- nautobot/project-static/docs/index.html +2 -2
- nautobot/project-static/docs/overview/application_stack.html +2 -2
- nautobot/project-static/docs/overview/design_philosophy.html +2 -2
- nautobot/project-static/docs/release-notes/index.html +2 -2
- nautobot/project-static/docs/release-notes/version-1.0.html +2 -2
- nautobot/project-static/docs/release-notes/version-1.1.html +2 -2
- nautobot/project-static/docs/release-notes/version-1.2.html +2 -2
- nautobot/project-static/docs/release-notes/version-1.3.html +2 -2
- nautobot/project-static/docs/release-notes/version-1.4.html +2 -2
- nautobot/project-static/docs/release-notes/version-1.5.html +2 -2
- nautobot/project-static/docs/release-notes/version-1.6.html +2 -2
- nautobot/project-static/docs/release-notes/version-2.0.html +2 -2
- nautobot/project-static/docs/release-notes/version-2.1.html +2 -2
- nautobot/project-static/docs/release-notes/version-2.2.html +2 -2
- nautobot/project-static/docs/release-notes/version-2.3.html +536 -216
- nautobot/project-static/docs/requirements.txt +2 -2
- nautobot/project-static/docs/search/search_index.json +1 -1
- nautobot/project-static/docs/sitemap.xml +270 -270
- nautobot/project-static/docs/sitemap.xml.gz +0 -0
- nautobot/project-static/docs/user-guide/administration/configuration/authentication/ldap.html +2 -2
- nautobot/project-static/docs/user-guide/administration/configuration/authentication/remote.html +2 -2
- nautobot/project-static/docs/user-guide/administration/configuration/authentication/sso.html +2 -2
- nautobot/project-static/docs/user-guide/administration/configuration/index.html +2 -2
- nautobot/project-static/docs/user-guide/administration/configuration/redis.html +2 -2
- nautobot/project-static/docs/user-guide/administration/configuration/settings.html +29 -2
- nautobot/project-static/docs/user-guide/administration/configuration/time-zones.html +2 -2
- nautobot/project-static/docs/user-guide/administration/guides/celery-queues.html +2 -2
- nautobot/project-static/docs/user-guide/administration/guides/docker.html +2 -2
- nautobot/project-static/docs/user-guide/administration/guides/health-checks.html +2 -2
- nautobot/project-static/docs/user-guide/administration/guides/permissions.html +2 -2
- nautobot/project-static/docs/user-guide/administration/guides/prometheus-metrics.html +2 -2
- nautobot/project-static/docs/user-guide/administration/guides/replicating-nautobot.html +2 -2
- nautobot/project-static/docs/user-guide/administration/guides/request-profiling.html +2 -2
- nautobot/project-static/docs/user-guide/administration/guides/s3-django-storage.html +2 -2
- nautobot/project-static/docs/user-guide/administration/guides/selinux-troubleshooting.html +2 -2
- nautobot/project-static/docs/user-guide/administration/installation/app-install.html +2 -2
- nautobot/project-static/docs/user-guide/administration/installation/external-authentication.html +2 -2
- nautobot/project-static/docs/user-guide/administration/installation/http-server.html +2 -2
- nautobot/project-static/docs/user-guide/administration/installation/index.html +2 -2
- nautobot/project-static/docs/user-guide/administration/installation/install_system.html +2 -2
- nautobot/project-static/docs/user-guide/administration/installation/nautobot.html +2 -2
- nautobot/project-static/docs/user-guide/administration/installation/services.html +2 -2
- nautobot/project-static/docs/user-guide/administration/migration/migrating-from-netbox.html +2 -2
- nautobot/project-static/docs/user-guide/administration/migration/migrating-from-postgresql.html +2 -2
- nautobot/project-static/docs/user-guide/administration/tools/nautobot-server.html +2 -2
- nautobot/project-static/docs/user-guide/administration/tools/nautobot-shell.html +2 -2
- nautobot/project-static/docs/user-guide/administration/upgrading/database-backup.html +2 -2
- nautobot/project-static/docs/user-guide/administration/upgrading/from-v1/ipam/after-you-upgrade.html +2 -2
- nautobot/project-static/docs/user-guide/administration/upgrading/from-v1/ipam/before-you-upgrade.html +2 -2
- nautobot/project-static/docs/user-guide/administration/upgrading/from-v1/ipam/for-developers.html +2 -2
- nautobot/project-static/docs/user-guide/administration/upgrading/from-v1/ipam/index.html +2 -2
- nautobot/project-static/docs/user-guide/administration/upgrading/from-v1/ipam/whats-changed.html +2 -2
- nautobot/project-static/docs/user-guide/administration/upgrading/from-v1/region-and-site-data-migration-guide.html +2 -2
- nautobot/project-static/docs/user-guide/administration/upgrading/from-v1/upgrading-from-nautobot-v1.html +2 -2
- nautobot/project-static/docs/user-guide/administration/upgrading/upgrading.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/circuits/circuit.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/circuits/circuittermination.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/circuits/circuittype.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/circuits/provider.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/circuits/providernetwork.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/cloud/cloud.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/cloud/cloudaccount.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/cloud/cloudnetwork.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/cloud/cloudnetworkprefixassignment.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/cloud/cloudresourcetype.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/cloud/cloudservice.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/cloud/cloudservicenetworkassignment.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/cable.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/consoleport.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/consoleporttemplate.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/consoleserverport.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/consoleserverporttemplate.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/controller.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/controllermanageddevicegroup.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/device.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/devicebay.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/devicebaytemplate.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/devicefamily.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/deviceredundancygroup.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/devicetype.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/frontport.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/frontporttemplate.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/interface.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/interfaceredundancygroup.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/interfacetemplate.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/inventoryitem.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/location.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/locationtype.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/manufacturer.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/module.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/modulebay.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/modulebaytemplate.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/moduletype.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/platform.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/powerfeed.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/poweroutlet.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/poweroutlettemplate.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/powerpanel.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/powerport.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/powerporttemplate.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/rack.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/rackgroup.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/rackreservation.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/rearport.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/rearporttemplate.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/softwareimagefile.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/softwareversion.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/dcim/virtualchassis.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/extras/configcontext.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/extras/configcontextschema.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/extras/contact.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/extras/team.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/ipam/ipaddress.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/ipam/namespace.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/ipam/prefix.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/ipam/rir.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/ipam/routetarget.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/ipam/service.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/ipam/vlan.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/ipam/vlangroup.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/ipam/vrf.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/overview/introduction.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/tenancy/tenant.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/tenancy/tenantgroup.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/virtualization/cluster.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/virtualization/clustergroup.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/virtualization/clustertype.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/virtualization/virtualmachine.html +2 -2
- nautobot/project-static/docs/user-guide/core-data-model/virtualization/vminterface.html +2 -2
- nautobot/project-static/docs/user-guide/feature-guides/contacts-and-teams.html +2 -2
- nautobot/project-static/docs/user-guide/feature-guides/custom-fields.html +2 -2
- nautobot/project-static/docs/user-guide/feature-guides/getting-started/creating-devices.html +2 -2
- nautobot/project-static/docs/user-guide/feature-guides/getting-started/creating-location-types-and-locations.html +2 -2
- nautobot/project-static/docs/user-guide/feature-guides/getting-started/index.html +2 -2
- nautobot/project-static/docs/user-guide/feature-guides/getting-started/interfaces.html +2 -2
- nautobot/project-static/docs/user-guide/feature-guides/getting-started/ipam.html +2 -2
- nautobot/project-static/docs/user-guide/feature-guides/getting-started/platforms.html +2 -2
- nautobot/project-static/docs/user-guide/feature-guides/getting-started/search-bar.html +2 -2
- nautobot/project-static/docs/user-guide/feature-guides/getting-started/tenants.html +2 -2
- nautobot/project-static/docs/user-guide/feature-guides/getting-started/vlans-and-vlan-groups.html +2 -2
- nautobot/project-static/docs/user-guide/feature-guides/git-data-source.html +2 -2
- nautobot/project-static/docs/user-guide/feature-guides/graphql.html +2 -2
- nautobot/project-static/docs/user-guide/feature-guides/ip-address-merge-tool.html +2 -2
- nautobot/project-static/docs/user-guide/feature-guides/relationships.html +2 -2
- nautobot/project-static/docs/user-guide/feature-guides/software-image-files-and-versions.html +2 -2
- nautobot/project-static/docs/user-guide/index.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/change-logging.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/computedfield.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/customfield.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/customlink.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/dynamicgroup.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/exporttemplate.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/externalintegration.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/gitrepository.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/graphql.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/graphqlquery.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/imageattachment.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/jobs/index.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/jobs/job-scheduling-and-approvals.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/jobs/jobbutton.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/jobs/jobhook.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/jobs/models.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/napalm.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/note.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/objectmetadata.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/relationship.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/rest-api/authentication.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/rest-api/filtering.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/rest-api/overview.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/rest-api/ui-related-endpoints.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/role.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/savedview.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/secret.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/staticgroupassociation.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/status.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/tag.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/template-filters.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/users/objectpermission.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/users/token.html +2 -2
- nautobot/project-static/docs/user-guide/platform-functionality/webhook.html +2 -2
- {nautobot-2.3.13.dist-info → nautobot-2.3.15.dist-info}/METADATA +5 -4
- {nautobot-2.3.13.dist-info → nautobot-2.3.15.dist-info}/RECORD +314 -315
- nautobot/core/fixtures/user-data.json +0 -59
- {nautobot-2.3.13.dist-info → nautobot-2.3.15.dist-info}/LICENSE.txt +0 -0
- {nautobot-2.3.13.dist-info → nautobot-2.3.15.dist-info}/NOTICE +0 -0
- {nautobot-2.3.13.dist-info → nautobot-2.3.15.dist-info}/WHEEL +0 -0
- {nautobot-2.3.13.dist-info → nautobot-2.3.15.dist-info}/entry_points.txt +0 -0
nautobot/circuits/tables.py
CHANGED
|
@@ -110,6 +110,7 @@ class CircuitTable(StatusTableMixin, BaseTable):
|
|
|
110
110
|
pk = ToggleColumn()
|
|
111
111
|
cid = tables.LinkColumn(verbose_name="ID")
|
|
112
112
|
provider = tables.Column(linkify=True)
|
|
113
|
+
circuit_type = tables.Column(linkify=True)
|
|
113
114
|
tenant = TenantColumn()
|
|
114
115
|
tags = TagColumn(url_name="circuits:circuit_list")
|
|
115
116
|
|
|
@@ -146,7 +147,7 @@ class CircuitTable(StatusTableMixin, BaseTable):
|
|
|
146
147
|
"pk",
|
|
147
148
|
"cid",
|
|
148
149
|
"provider",
|
|
149
|
-
"
|
|
150
|
+
"circuit_type",
|
|
150
151
|
"status",
|
|
151
152
|
"tenant",
|
|
152
153
|
"circuit_termination_a",
|
nautobot/core/filters.py
CHANGED
|
@@ -618,6 +618,7 @@ class BaseFilterSet(django_filters.FilterSet):
|
|
|
618
618
|
@staticmethod
|
|
619
619
|
def _get_filter_lookup_dict(existing_filter):
|
|
620
620
|
# Choose the lookup expression map based on the filter type
|
|
621
|
+
|
|
621
622
|
if isinstance(
|
|
622
623
|
existing_filter,
|
|
623
624
|
(
|
|
@@ -637,6 +638,7 @@ class BaseFilterSet(django_filters.FilterSet):
|
|
|
637
638
|
(
|
|
638
639
|
django_filters.ModelChoiceFilter,
|
|
639
640
|
django_filters.ModelMultipleChoiceFilter,
|
|
641
|
+
MultiValueUUIDFilter,
|
|
640
642
|
TagFilter,
|
|
641
643
|
TreeNodeMultipleChoiceFilter,
|
|
642
644
|
),
|
nautobot/core/jobs/cleanup.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from datetime import timedelta
|
|
2
2
|
|
|
3
3
|
from django.core.exceptions import PermissionDenied
|
|
4
|
+
from django.db.models import CASCADE
|
|
4
5
|
from django.db.models.signals import pre_delete
|
|
5
6
|
from django.utils import timezone
|
|
6
7
|
|
|
@@ -48,6 +49,27 @@ class LogsCleanup(Job):
|
|
|
48
49
|
description = "Delete ObjectChange and/or JobResult/JobLogEntry records older than a specified cutoff."
|
|
49
50
|
has_sensitive_variables = False
|
|
50
51
|
|
|
52
|
+
def recursive_delete_with_cascade(self, queryset, deletion_summary):
|
|
53
|
+
"""
|
|
54
|
+
Recursively deletes all related objects with CASCADE for a given queryset.
|
|
55
|
+
|
|
56
|
+
Args:
|
|
57
|
+
queryset (QuerySet): The queryset of objects to delete.
|
|
58
|
+
deletion_summary (dict): A dictionary to store the count of deleted objects for each model.
|
|
59
|
+
"""
|
|
60
|
+
related_objects = queryset.model._meta.related_objects
|
|
61
|
+
queryset = queryset.only("id")
|
|
62
|
+
|
|
63
|
+
for related_object in related_objects:
|
|
64
|
+
if related_object.on_delete is CASCADE:
|
|
65
|
+
related_model = related_object.related_model
|
|
66
|
+
related_field_name = related_object.field.name
|
|
67
|
+
cascade_queryset = related_model.objects.filter(**{f"{related_field_name}__id__in": queryset})
|
|
68
|
+
self.recursive_delete_with_cascade(cascade_queryset, deletion_summary)
|
|
69
|
+
_, deleted_dict = queryset.delete()
|
|
70
|
+
deletion_summary.update(deleted_dict)
|
|
71
|
+
return deletion_summary
|
|
72
|
+
|
|
51
73
|
def run(self, *, cleanup_types, max_age=None):
|
|
52
74
|
if max_age in (None, ""):
|
|
53
75
|
max_age = get_settings_or_config("CHANGELOG_RETENTION")
|
|
@@ -77,22 +99,36 @@ class LogsCleanup(Job):
|
|
|
77
99
|
|
|
78
100
|
if CleanupTypes.JOB_RESULT in cleanup_types:
|
|
79
101
|
self.logger.info("Deleting JobResult records prior to %s", cutoff)
|
|
80
|
-
|
|
102
|
+
queryset = JobResult.objects.restrict(self.user, "delete").filter(date_done__lt=cutoff)
|
|
103
|
+
deletion_summary = {}
|
|
104
|
+
self.recursive_delete_with_cascade(queryset, deletion_summary)
|
|
81
105
|
result.setdefault("extras.JobResult", 0)
|
|
82
106
|
result.setdefault("extras.JobLogEntry", 0)
|
|
83
|
-
result.update(
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
107
|
+
result.update(deletion_summary)
|
|
108
|
+
|
|
109
|
+
for modelname, count in deletion_summary.items():
|
|
110
|
+
self.logger.info(
|
|
111
|
+
"As part of deleting %d JobResult records, also deleted %d related %s records",
|
|
112
|
+
result["extras.JobResult"],
|
|
113
|
+
count,
|
|
114
|
+
modelname,
|
|
115
|
+
)
|
|
89
116
|
|
|
90
117
|
if CleanupTypes.OBJECT_CHANGE in cleanup_types:
|
|
91
118
|
self.logger.info("Deleting ObjectChange records prior to %s", cutoff)
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
119
|
+
queryset = ObjectChange.objects.restrict(self.user, "delete").filter(time__lt=cutoff)
|
|
120
|
+
deletion_summary = {}
|
|
121
|
+
self.recursive_delete_with_cascade(queryset, deletion_summary)
|
|
122
|
+
result.setdefault("extras.ObjectChange", 0)
|
|
123
|
+
result.update(deletion_summary)
|
|
124
|
+
|
|
125
|
+
for modelname, count in deletion_summary.items():
|
|
126
|
+
self.logger.info(
|
|
127
|
+
"As part of deleting %d ObjectChange records, also deleted %d related %s records",
|
|
128
|
+
result["extras.ObjectChange"],
|
|
129
|
+
count,
|
|
130
|
+
modelname,
|
|
131
|
+
)
|
|
96
132
|
return result
|
|
97
133
|
finally:
|
|
98
134
|
# Be sure to clean up after ourselves!
|
nautobot/core/settings.py
CHANGED
|
@@ -173,6 +173,9 @@ PLUGINS_CONFIG = {}
|
|
|
173
173
|
if "NAUTOBOT_PREFER_IPV4" in os.environ and os.environ["NAUTOBOT_PREFER_IPV4"] != "":
|
|
174
174
|
PREFER_IPV4 = is_truthy(os.environ["NAUTOBOT_PREFER_IPV4"])
|
|
175
175
|
|
|
176
|
+
# Publish a simple "no-index" robots.txt for Nautobot?
|
|
177
|
+
PUBLISH_ROBOTS_TXT = is_truthy(os.getenv("NAUTOBOT_PUBLISH_ROBOTS_TXT", "True"))
|
|
178
|
+
|
|
176
179
|
# Default height and width in pixels of a single rack unit in rendered rack elevations. Defaults are 22 and 220
|
|
177
180
|
if (
|
|
178
181
|
"NAUTOBOT_RACK_ELEVATION_DEFAULT_UNIT_HEIGHT" in os.environ
|
nautobot/core/settings.yaml
CHANGED
|
@@ -1473,6 +1473,14 @@ properties:
|
|
|
1473
1473
|
environment_variable: "NAUTOBOT_PREFER_IPV4"
|
|
1474
1474
|
is_constance_config: true
|
|
1475
1475
|
type: "boolean"
|
|
1476
|
+
PUBLISH_ROBOTS_TXT:
|
|
1477
|
+
default: true
|
|
1478
|
+
description: >-
|
|
1479
|
+
Setting this to true causes Nautobot to publish a `robots.txt` that discourages indexing by web crawlers.
|
|
1480
|
+
Irrelevant if deployed behind a firewall.
|
|
1481
|
+
environment_variable: "NAUTOBOT_PUBLISH_ROBOTS_TXT"
|
|
1482
|
+
type: "boolean"
|
|
1483
|
+
version_added: "2.3.15"
|
|
1476
1484
|
RACK_ELEVATION_DEFAULT_UNIT_HEIGHT:
|
|
1477
1485
|
default: 22
|
|
1478
1486
|
description: >-
|
|
@@ -47,3 +47,6 @@
|
|
|
47
47
|
<meta name="theme-color" content="#ffffff">
|
|
48
48
|
<meta charset="UTF-8">
|
|
49
49
|
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
|
|
50
|
+
{% if settings.PUBLISH_ROBOTS_TXT %}
|
|
51
|
+
<meta name="robots" content="noindex, nofollow">
|
|
52
|
+
{% endif %}
|
|
@@ -490,6 +490,9 @@ INSTALLATION_METRICS_ENABLED = is_truthy(os.getenv("NAUTOBOT_INSTALLATION_METRIC
|
|
|
490
490
|
# if "NAUTOBOT_PREFER_IPV4" in os.environ and os.environ["NAUTOBOT_PREFER_IPV4"] != "":
|
|
491
491
|
# PREFER_IPV4 = is_truthy(os.environ["NAUTOBOT_PREFER_IPV4"])
|
|
492
492
|
|
|
493
|
+
# Publish a simple "no-index" robots.txt for Nautobot?
|
|
494
|
+
# PUBLISH_ROBOTS_TXT = is_truthy(os.getenv("NAUTOBOT_PUBLISH_ROBOTS_TXT", "True"))
|
|
495
|
+
|
|
493
496
|
# Default height and width in pixels of a single rack unit in rendered rack elevations. Defaults are 22 and 230
|
|
494
497
|
#
|
|
495
498
|
# if (
|
nautobot/core/testing/filters.py
CHANGED
|
@@ -88,11 +88,26 @@ class FilterTestCases:
|
|
|
88
88
|
return self.filterset.declared_filters["q"].filter_predicates
|
|
89
89
|
|
|
90
90
|
def test_id(self):
|
|
91
|
-
"""Verify that the filterset supports filtering by id
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
91
|
+
"""Verify that the filterset supports filtering by id with only lookup `__n`."""
|
|
92
|
+
with self.subTest("Assert `id`"):
|
|
93
|
+
params = {"id": list(self.queryset.values_list("pk", flat=True)[:2])}
|
|
94
|
+
expected_queryset = self.queryset.filter(id__in=params["id"])
|
|
95
|
+
filterset = self.filterset(params, self.queryset)
|
|
96
|
+
self.assertTrue(filterset.is_valid())
|
|
97
|
+
self.assertQuerysetEqualAndNotEmpty(filterset.qs.order_by("id"), expected_queryset.order_by("id"))
|
|
98
|
+
|
|
99
|
+
with self.subTest("Assert negate lookup"):
|
|
100
|
+
params = {"id__n": list(self.queryset.values_list("pk", flat=True)[:2])}
|
|
101
|
+
expected_queryset = self.queryset.exclude(id__in=params["id__n"])
|
|
102
|
+
filterset = self.filterset(params, self.queryset)
|
|
103
|
+
self.assertTrue(filterset.is_valid())
|
|
104
|
+
self.assertQuerysetEqualAndNotEmpty(filterset.qs.order_by("id"), expected_queryset.order_by("id"))
|
|
105
|
+
|
|
106
|
+
with self.subTest("Assert invalid lookup"):
|
|
107
|
+
params = {"id__in": list(self.queryset.values_list("pk", flat=True)[:2])}
|
|
108
|
+
filterset = self.filterset(params, self.queryset)
|
|
109
|
+
self.assertFalse(filterset.is_valid())
|
|
110
|
+
self.assertIn("Unknown filter field", filterset.errors.as_text())
|
|
96
111
|
|
|
97
112
|
def test_invalid_filter(self):
|
|
98
113
|
"""Verify that the filterset reports as invalid when initialized with an unsupported filter parameter."""
|
nautobot/core/testing/mixins.py
CHANGED
|
@@ -144,13 +144,18 @@ class NautobotTestCaseMixin:
|
|
|
144
144
|
# Permissions management
|
|
145
145
|
#
|
|
146
146
|
|
|
147
|
-
def add_permissions(self, *names):
|
|
147
|
+
def add_permissions(self, *names, **kwargs):
|
|
148
148
|
"""
|
|
149
149
|
Assign a set of permissions to the test user. Accepts permission names in the form <app>.<action>_<model>.
|
|
150
|
+
Additional keyword arguments will be passed to the ObjectPermission constructor to allow creating more detailed permissions.
|
|
151
|
+
|
|
152
|
+
Examples:
|
|
153
|
+
>>> add_permissions("ipam.add_vlangroup", "ipam.view_vlangroup")
|
|
154
|
+
>>> add_permissions("ipam.add_vlangroup", "ipam.view_vlangroup", constraints={"pk": "uuid-1234"})
|
|
150
155
|
"""
|
|
151
156
|
for name in names:
|
|
152
157
|
ct, action = permissions.resolve_permission_ct(name)
|
|
153
|
-
obj_perm = users_models.ObjectPermission(name=name, actions=[action])
|
|
158
|
+
obj_perm = users_models.ObjectPermission(name=name, actions=[action], **kwargs)
|
|
154
159
|
obj_perm.save()
|
|
155
160
|
obj_perm.users.add(self.user)
|
|
156
161
|
obj_perm.object_types.add(ct)
|
|
@@ -9,7 +9,6 @@ from example_app.models import ExampleModel
|
|
|
9
9
|
class AppHomeTestCase(SeleniumTestCase):
|
|
10
10
|
"""Integration test the Example App homepage extensions."""
|
|
11
11
|
|
|
12
|
-
fixtures = ["user-data.json"] # bob/bob
|
|
13
12
|
layout = {
|
|
14
13
|
"Organization": {
|
|
15
14
|
"Locations": {"model": Location, "permission": "dcim.view_location"},
|
|
@@ -11,8 +11,6 @@ from nautobot.extras.models import CustomField, CustomFieldChoice, Status
|
|
|
11
11
|
class ListViewFilterTestCase(SeleniumTestCase):
|
|
12
12
|
"""Integration test for the list view filter ui."""
|
|
13
13
|
|
|
14
|
-
fixtures = ["user-data.json"]
|
|
15
|
-
|
|
16
14
|
def setUp(self):
|
|
17
15
|
super().setUp()
|
|
18
16
|
self.login(self.user.username, self.password)
|
|
@@ -7,7 +7,6 @@ from nautobot.tenancy.models import Tenant
|
|
|
7
7
|
class HomeTestCase(SeleniumTestCase):
|
|
8
8
|
"""Integration tests against the home page."""
|
|
9
9
|
|
|
10
|
-
fixtures = ["user-data.json"] # bob/bob
|
|
11
10
|
layout = {
|
|
12
11
|
"Organization": {
|
|
13
12
|
"Locations": {"model": Location, "permission": "dcim.view_location"},
|
|
@@ -594,3 +594,32 @@ class ExampleViewWithCustomPermissionsTest(TestCase):
|
|
|
594
594
|
self.user.save()
|
|
595
595
|
response = self.client.get(url)
|
|
596
596
|
self.assertBodyContains(response, "You are viewing a table of example models")
|
|
597
|
+
|
|
598
|
+
|
|
599
|
+
class SearchRobotsTestCase(TestCase):
|
|
600
|
+
def test_robots_disallowed(self):
|
|
601
|
+
"""
|
|
602
|
+
Test that the robots.txt file is accessible to all users and defaults to disallowing all bots.
|
|
603
|
+
"""
|
|
604
|
+
url = reverse("robots_txt")
|
|
605
|
+
response = self.client.get(url)
|
|
606
|
+
self.assertHttpStatus(response, 200)
|
|
607
|
+
self.assertBodyContains(response, "User-Agent: *")
|
|
608
|
+
self.assertBodyContains(response, "Disallow: /")
|
|
609
|
+
|
|
610
|
+
url = reverse("home")
|
|
611
|
+
response = self.client.get(url)
|
|
612
|
+
self.assertContains(response, '<meta name="robots" content="noindex, nofollow">', html=True)
|
|
613
|
+
|
|
614
|
+
@override_settings(PUBLISH_ROBOTS_TXT=False)
|
|
615
|
+
def test_robots_allowed(self):
|
|
616
|
+
"""
|
|
617
|
+
Test that the robots.txt file is not published if PUBLISH_ROBOTS_TXT is set to False.
|
|
618
|
+
"""
|
|
619
|
+
url = reverse("robots_txt")
|
|
620
|
+
response = self.client.get(url)
|
|
621
|
+
self.assertHttpStatus(response, 404)
|
|
622
|
+
|
|
623
|
+
url = reverse("home")
|
|
624
|
+
response = self.client.get(url)
|
|
625
|
+
self.assertNotContains(response, '<meta name="robots" content="noindex, nofollow">', html=True)
|
nautobot/core/urls.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from django.conf import settings
|
|
2
|
+
from django.http import HttpResponse, HttpResponseNotFound
|
|
2
3
|
from django.urls import include, path
|
|
3
4
|
from django.views.generic import TemplateView
|
|
4
5
|
from django.views.static import serve
|
|
@@ -72,6 +73,14 @@ urlpatterns = [
|
|
|
72
73
|
path(
|
|
73
74
|
"template.css", TemplateView.as_view(template_name="template.css", content_type="text/css"), name="template_css"
|
|
74
75
|
),
|
|
76
|
+
# The response is conditional as opposed to wrapping the path() call in an if statement to be able to test the setting with current test setup
|
|
77
|
+
path(
|
|
78
|
+
"robots.txt",
|
|
79
|
+
lambda x: HttpResponse("User-Agent: *\nDisallow: /", content_type="text/plain")
|
|
80
|
+
if settings.PUBLISH_ROBOTS_TXT
|
|
81
|
+
else HttpResponseNotFound(),
|
|
82
|
+
name="robots_txt",
|
|
83
|
+
),
|
|
75
84
|
]
|
|
76
85
|
|
|
77
86
|
|
nautobot/dcim/forms.py
CHANGED
|
@@ -792,7 +792,7 @@ class DeviceFamilyFilterForm(NautobotFilterForm):
|
|
|
792
792
|
tags = TagFilterField(model)
|
|
793
793
|
|
|
794
794
|
|
|
795
|
-
class DeviceFamilyBulkEditForm(
|
|
795
|
+
class DeviceFamilyBulkEditForm(TagsBulkEditFormMixin, NautobotBulkEditForm):
|
|
796
796
|
pk = forms.ModelMultipleChoiceField(queryset=DeviceFamily.objects.all(), widget=forms.MultipleHiddenInput())
|
|
797
797
|
description = forms.CharField(required=False)
|
|
798
798
|
|
|
@@ -3183,9 +3183,6 @@ class InterfaceBulkEditForm(
|
|
|
3183
3183
|
untagged_vlan = DynamicModelChoiceField(
|
|
3184
3184
|
queryset=VLAN.objects.all(),
|
|
3185
3185
|
required=False,
|
|
3186
|
-
query_params={
|
|
3187
|
-
"locations": "null",
|
|
3188
|
-
},
|
|
3189
3186
|
)
|
|
3190
3187
|
tagged_vlans = DynamicModelMultipleChoiceField(
|
|
3191
3188
|
queryset=VLAN.objects.all(),
|
|
@@ -3235,8 +3232,12 @@ class InterfaceBulkEditForm(
|
|
|
3235
3232
|
# Limit VLAN choices by Location
|
|
3236
3233
|
if locations.count() == 1:
|
|
3237
3234
|
location = locations.first()
|
|
3238
|
-
|
|
3235
|
+
# In the case of a single location, use the available_on_device query param to limit untagged VLAN choices
|
|
3236
|
+
# to those available on the devices in that location and in the ancestors of the location.
|
|
3237
|
+
self.fields["untagged_vlan"].widget.add_query_param("available_on_device", device.pk)
|
|
3239
3238
|
self.fields["tagged_vlans"].widget.add_query_param("locations", location.pk)
|
|
3239
|
+
else:
|
|
3240
|
+
self.fields["tagged_vlans"].widget.add_query_param("locations", "null")
|
|
3240
3241
|
|
|
3241
3242
|
# Restrict parent/bridge/LAG interface assignment by device (or VC master)
|
|
3242
3243
|
if device_count == 1:
|
nautobot/dcim/models/devices.py
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
from django.test import TestCase
|
|
2
2
|
|
|
3
3
|
from nautobot.core.testing.forms import FormTestCases
|
|
4
|
+
from nautobot.core.testing.mixins import NautobotTestCaseMixin
|
|
4
5
|
from nautobot.dcim.choices import DeviceFaceChoices, InterfaceModeChoices, InterfaceTypeChoices, RackWidthChoices
|
|
5
|
-
from nautobot.dcim.forms import
|
|
6
|
+
from nautobot.dcim.forms import (
|
|
7
|
+
DeviceFilterForm,
|
|
8
|
+
DeviceForm,
|
|
9
|
+
InterfaceBulkEditForm,
|
|
10
|
+
InterfaceCreateForm,
|
|
11
|
+
InterfaceForm,
|
|
12
|
+
RackForm,
|
|
13
|
+
)
|
|
6
14
|
from nautobot.dcim.models import (
|
|
7
15
|
Device,
|
|
8
16
|
DeviceType,
|
|
@@ -320,7 +328,7 @@ class RackTestCase(TestCase):
|
|
|
320
328
|
self.assertTrue(form.is_valid())
|
|
321
329
|
|
|
322
330
|
|
|
323
|
-
class InterfaceTestCase(TestCase):
|
|
331
|
+
class InterfaceTestCase(NautobotTestCaseMixin, TestCase):
|
|
324
332
|
@classmethod
|
|
325
333
|
def setUpTestData(cls):
|
|
326
334
|
cls.device = Device.objects.first()
|
|
@@ -380,3 +388,44 @@ class InterfaceTestCase(TestCase):
|
|
|
380
388
|
self.vlan.locations.clear()
|
|
381
389
|
form = InterfaceForm(data=self.data, instance=self.interface)
|
|
382
390
|
self.assertTrue(form.is_valid())
|
|
391
|
+
|
|
392
|
+
def test_untagged_vlans_dropdown_options_align_in_interface_edit_form_and_bulk_edit_form(self):
|
|
393
|
+
"""
|
|
394
|
+
Assert that untagged_vlans field dropdown are populated correctly in InterfaceForm and InterfaceBulkEditForm,
|
|
395
|
+
and that the queryset is the same for both forms.
|
|
396
|
+
"""
|
|
397
|
+
status = Status.objects.get_for_model(Interface).first()
|
|
398
|
+
location = Location.objects.filter(location_type=LocationType.objects.get(name="Campus")).first()
|
|
399
|
+
devices = Device.objects.all()[:3]
|
|
400
|
+
for device in devices:
|
|
401
|
+
device.location = location
|
|
402
|
+
device.save()
|
|
403
|
+
interfaces = (
|
|
404
|
+
Interface.objects.create(
|
|
405
|
+
device=devices[0],
|
|
406
|
+
name="Test Interface 1",
|
|
407
|
+
type=InterfaceTypeChoices.TYPE_2GFC_SFP,
|
|
408
|
+
status=status,
|
|
409
|
+
),
|
|
410
|
+
Interface.objects.create(
|
|
411
|
+
device=devices[1],
|
|
412
|
+
name="Test Interface 2",
|
|
413
|
+
type=InterfaceTypeChoices.TYPE_LAG,
|
|
414
|
+
status=status,
|
|
415
|
+
),
|
|
416
|
+
Interface.objects.create(
|
|
417
|
+
device=devices[2],
|
|
418
|
+
name="Test Interface 3",
|
|
419
|
+
type=InterfaceTypeChoices.TYPE_100ME_FIXED,
|
|
420
|
+
status=status,
|
|
421
|
+
),
|
|
422
|
+
)
|
|
423
|
+
edit_form = InterfaceForm(data=self.data, instance=interfaces[0])
|
|
424
|
+
bulk_edit_form = InterfaceBulkEditForm(
|
|
425
|
+
model=Interface,
|
|
426
|
+
data={"pks": [interface.pk for interface in interfaces]},
|
|
427
|
+
)
|
|
428
|
+
self.assertQuerysetEqualAndNotEmpty(
|
|
429
|
+
edit_form.fields["untagged_vlan"].queryset,
|
|
430
|
+
bulk_edit_form.fields["untagged_vlan"].queryset,
|
|
431
|
+
)
|
nautobot/extras/forms/mixins.py
CHANGED
|
@@ -837,13 +837,21 @@ class StatusModelFilterFormMixin(forms.Form):
|
|
|
837
837
|
self.order_fields(self.field_order) # Reorder fields again
|
|
838
838
|
|
|
839
839
|
|
|
840
|
-
class TagsBulkEditFormMixin(
|
|
840
|
+
class TagsBulkEditFormMixin(BulkEditForm):
|
|
841
841
|
def __init__(self, *args, **kwargs):
|
|
842
842
|
super().__init__(*args, **kwargs)
|
|
843
843
|
|
|
844
844
|
# Add add/remove tags fields
|
|
845
|
-
self.fields["add_tags"] = DynamicModelMultipleChoiceField(
|
|
846
|
-
|
|
845
|
+
self.fields["add_tags"] = DynamicModelMultipleChoiceField(
|
|
846
|
+
queryset=Tag.objects.all(),
|
|
847
|
+
query_params={"content_types": self.model._meta.label_lower},
|
|
848
|
+
required=False,
|
|
849
|
+
)
|
|
850
|
+
self.fields["remove_tags"] = DynamicModelMultipleChoiceField(
|
|
851
|
+
queryset=Tag.objects.all(),
|
|
852
|
+
query_params={"content_types": self.model._meta.label_lower},
|
|
853
|
+
required=False,
|
|
854
|
+
)
|
|
847
855
|
|
|
848
856
|
|
|
849
857
|
# 2.2 TODO: Names below are only for backward compatibility with Nautobot 1.3 and earlier. Remove in 2.2
|
nautobot/extras/jobs.py
CHANGED
|
@@ -98,13 +98,15 @@ class BaseJob:
|
|
|
98
98
|
|
|
99
99
|
- name (str)
|
|
100
100
|
- description (str)
|
|
101
|
-
- hidden (bool)
|
|
102
|
-
- field_order (list)
|
|
103
101
|
- approval_required (bool)
|
|
104
|
-
-
|
|
105
|
-
-
|
|
102
|
+
- dryrun_default (bool)
|
|
103
|
+
- field_order (list)
|
|
106
104
|
- has_sensitive_variables (bool)
|
|
105
|
+
- hidden (bool)
|
|
106
|
+
- soft_time_limit (int)
|
|
107
107
|
- task_queues (list)
|
|
108
|
+
- template_name (str)
|
|
109
|
+
- time_limit (int)
|
|
108
110
|
"""
|
|
109
111
|
|
|
110
112
|
def __init__(self):
|
|
@@ -578,7 +578,13 @@ class CustomField(
|
|
|
578
578
|
)
|
|
579
579
|
|
|
580
580
|
def to_form_field(
|
|
581
|
-
self,
|
|
581
|
+
self,
|
|
582
|
+
set_initial=True,
|
|
583
|
+
enforce_required=True,
|
|
584
|
+
for_csv_import=False,
|
|
585
|
+
simple_json_filter=False,
|
|
586
|
+
label=None,
|
|
587
|
+
for_filter_form=False,
|
|
582
588
|
):
|
|
583
589
|
"""
|
|
584
590
|
Return a form field suitable for setting a CustomField's value for an object.
|
|
@@ -590,6 +596,7 @@ class CustomField(
|
|
|
590
596
|
this is *not* used for CSV imports since 2.0, but it *is* used for JSON/YAML import of DeviceTypes.
|
|
591
597
|
simple_json_filter: Return a TextInput widget for JSON filtering instead of the default TextArea widget.
|
|
592
598
|
label: Set the input label manually (if required); otherwise, defaults to field's __str__() implementation.
|
|
599
|
+
for_filter_form: If True return the relevant form field for filter form
|
|
593
600
|
"""
|
|
594
601
|
initial = self.default if set_initial else None
|
|
595
602
|
required = self.required if enforce_required else False
|
|
@@ -676,7 +683,7 @@ class CustomField(
|
|
|
676
683
|
default_choice = self.custom_field_choices.filter(value=self.default).first()
|
|
677
684
|
|
|
678
685
|
# Set the initial value to the first available choice (if any)
|
|
679
|
-
if self.type == CustomFieldTypeChoices.TYPE_SELECT:
|
|
686
|
+
if self.type == CustomFieldTypeChoices.TYPE_SELECT and not for_filter_form:
|
|
680
687
|
if not required or default_choice is None:
|
|
681
688
|
choices = add_blank_choice(choices)
|
|
682
689
|
field_class = CSVChoiceField if for_csv_import else forms.ChoiceField
|
|
@@ -704,16 +711,10 @@ class CustomField(
|
|
|
704
711
|
|
|
705
712
|
def to_filter_form_field(self, lookup_expr="exact", *args, **kwargs):
|
|
706
713
|
"""Return a filter form field suitable for filtering a CustomField's value for an object."""
|
|
707
|
-
form_field = self.to_form_field(*args, **kwargs)
|
|
708
|
-
# We would handle type selection differently because:
|
|
709
|
-
# 1. We'd need to use StaticSelect2Multiple for lookup_type 'exact' because self.type `select` uses StaticSelect2 by default.
|
|
710
|
-
# 2. Remove the blank choice since StaticSelect2Multiple is always blank and interprets the blank choice as an extra option.
|
|
711
|
-
# 3. If lookup_type is not the same as exact, use MultiValueCharInput
|
|
714
|
+
form_field = self.to_form_field(*args, **kwargs, for_filter_form=True)
|
|
715
|
+
# We would handle type selection differently because: If lookup_type is not the same as exact, use MultiValueCharInput
|
|
712
716
|
if self.type == CustomFieldTypeChoices.TYPE_SELECT:
|
|
713
|
-
if lookup_expr in ["exact", "contains"]:
|
|
714
|
-
choices = form_field.choices[1:]
|
|
715
|
-
form_field.widget = StaticSelect2Multiple(choices=choices)
|
|
716
|
-
else:
|
|
717
|
+
if lookup_expr not in ["exact", "contains"]:
|
|
717
718
|
form_field.widget = MultiValueCharInput()
|
|
718
719
|
return form_field
|
|
719
720
|
|
|
@@ -4,8 +4,6 @@ from nautobot.core.testing.integration import SeleniumTestCase
|
|
|
4
4
|
class PluginBannerTestCase(SeleniumTestCase):
|
|
5
5
|
"""Integration test for rendering of plugin-injected banner content."""
|
|
6
6
|
|
|
7
|
-
fixtures = ("user-data",)
|
|
8
|
-
|
|
9
7
|
def test_banner_not_rendered(self):
|
|
10
8
|
"""As implemented, plugin banner does not render if the user is not logged in.
|
|
11
9
|
|
|
@@ -4,12 +4,13 @@ import warnings
|
|
|
4
4
|
from django.contrib.auth import get_user_model
|
|
5
5
|
from django.contrib.contenttypes.models import ContentType
|
|
6
6
|
from django.db.models import Q
|
|
7
|
+
from django.forms import ChoiceField, MultipleChoiceField
|
|
7
8
|
from django.test import override_settings, TestCase
|
|
8
9
|
|
|
9
10
|
from nautobot.dcim.forms import DeviceForm, LocationBulkEditForm, LocationForm
|
|
10
11
|
import nautobot.dcim.models as dcim_models
|
|
11
12
|
from nautobot.dcim.models import Device, Location, LocationType
|
|
12
|
-
from nautobot.extras.choices import RelationshipTypeChoices
|
|
13
|
+
from nautobot.extras.choices import CustomFieldTypeChoices, RelationshipTypeChoices
|
|
13
14
|
from nautobot.extras.forms import (
|
|
14
15
|
ConfigContextFilterForm,
|
|
15
16
|
ConfigContextForm,
|
|
@@ -25,6 +26,7 @@ from nautobot.extras.forms import (
|
|
|
25
26
|
WebhookForm,
|
|
26
27
|
)
|
|
27
28
|
from nautobot.extras.models import (
|
|
29
|
+
CustomField,
|
|
28
30
|
Job,
|
|
29
31
|
JobButton,
|
|
30
32
|
JobHook,
|
|
@@ -1217,3 +1219,20 @@ class CustomFieldModelFormMixinTestCase(TestCase):
|
|
|
1217
1219
|
|
|
1218
1220
|
custom_field_form = TestForm()
|
|
1219
1221
|
self.assertIn("_custom_field_data", custom_field_form.fields)
|
|
1222
|
+
|
|
1223
|
+
|
|
1224
|
+
class CustomFieldTestCase(TestCase):
|
|
1225
|
+
def test_to_form_field_type_select(self):
|
|
1226
|
+
"""Verify that `to_form_field` and `to_filter_form_field` return the correct field types for a select-type CustomField."""
|
|
1227
|
+
custom_field = CustomField.objects.create(
|
|
1228
|
+
type=CustomFieldTypeChoices.TYPE_SELECT,
|
|
1229
|
+
label="Custom Field Select",
|
|
1230
|
+
)
|
|
1231
|
+
form = custom_field.to_filter_form_field()
|
|
1232
|
+
self.assertIsInstance(form, MultipleChoiceField)
|
|
1233
|
+
|
|
1234
|
+
form = custom_field.to_form_field(for_filter_form=True)
|
|
1235
|
+
self.assertIsInstance(form, MultipleChoiceField)
|
|
1236
|
+
|
|
1237
|
+
form = custom_field.to_form_field(for_filter_form=False)
|
|
1238
|
+
self.assertIsInstance(form, ChoiceField)
|