1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

279 Commits

Author SHA1 Message Date
75b71890a4 Misc i18n cleanup 2023-09-11 15:59:50 -04:00
2d1457b94b Fixes: #13682 - Fix custom field exceptions and validation (#13685)
* Fixes: #13682 - Fix custom field exceptions and validation

* Add tests

* Remove default setting for multi-select/multi-object and return slice of choices and annotate.

* Remove redundant default choice valiadtion; introduce values property on CustomFieldChoiceSet

* Refactor test

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2023-09-06 10:47:18 -04:00
2544e2bf18 Fixes #13622: Fix exception when viewing current config and no revisions have been created 2023-08-31 11:11:56 -04:00
eb9a804914 #12591: Add a dedicated view for the active config revision 2023-08-30 11:13:56 -04:00
914588f55d Merge branch 'develop' into feature 2023-08-09 15:31:21 -04:00
8b01c30c51 Exposes all models in device context data (#13389)
* exposes all models in device context data #12814

* added app namespaces to the context data

* revert object to device in context data

* moved context to render method of ConfigTemplate

* removed print

* Include only registered models; permit passed context data to overwrite apps

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2023-08-09 14:57:59 -04:00
dcdb4d27ec 12665 add semicolon to link sanitation safe string 2023-08-09 14:49:34 -04:00
f255fe507d Fixes #13410: Fix rendering of custom choice fields with large numner of choices 2023-08-08 09:32:56 -04:00
caedc8dbe3 Closes #13352: Translation support for model verbose names (#13354)
* Update verbose_name & verbose_name_plural Meta attributes on all models

* Alter makemigrations to ignore verbose_name & verbose_name_plural changes
2023-08-03 10:41:10 -04:00
24ffaf09d4 Fixes #13363: Fix API endpoint for custom field choice selector in forms 2023-08-03 08:53:46 -04:00
1cc78be6ca Adds custom field on webhook model (#13336)
* adds custom field on webhook model #11936

* adds tags on webhook model #11936

* Remove extraneous import; revert change to NetBoxModelForm (no longer needed)

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2023-08-01 14:05:47 -04:00
83bebc1bd2 Closes #13132: Wrap verbose_name and other model text with gettext_lazy() (i18n)
---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2023-07-31 11:28:07 -04:00
cf1b1a83eb Closes #12194: Add pre-defined custom field choices (#13219)
* Initial work on custom field choice sets

* Rename choices to extra_choices (prep for #12194)

* Remove CustomField.choices

* Add & update tests

* Clean up table columns

* Add order_alphanetically boolean for choice sets

* Introduce ArrayColumn for choice lists

* Show dependent custom fields on choice set view

* Update custom fields documentation

* Introduce ArrayWidget for more convenient editing of choices

* Incorporate PR feedback

* Misc cleanup

* Initial work on predefined choices for custom fields

* Misc cleanup

* Add IATA airport codes

* #13241: Add support for custom field choice labels

* Restore ArrayColumn

* Misc cleanup

* Change extra_choices back to a nested ArrayField to preserve choice ordering

* Hack to bypass GraphQL API test utility absent support for nested ArrayFields
2023-07-28 11:24:21 -04:00
96ea0ac9c7 Closes #12988: Introduce custom field choice sets (#13195)
* Initial work on custom field choice sets

* Rename choices to extra_choices (prep for #12194)

* Remove CustomField.choices

* Add & update tests

* Clean up table columns

* Add order_alphanetically boolean for choice sets

* Introduce ArrayColumn for choice lists

* Show dependent custom fields on choice set view

* Update custom fields documentation

* Introduce ArrayWidget for more convenient editing of choices

* Incorporate PR feedback

* Misc cleanup
2023-07-19 10:26:24 -04:00
837be4d45f Merge branch 'develop' into feature 2023-07-11 10:09:26 -04:00
63ba9fb38c Fixes #11335: Default manager for ObjectChange should filter by installed apps (#11709)
* Fixes #11335: Default manager for ObjectChange should filter by installed apps

* Employ canonical model discovery mechanism

* Move filtering logic to valid_models() queryset method

* fixed import to avoid content type does not exist

* Cleanup

---------

Co-authored-by: Abhimanyu Saharan <desk.abhimanyu@gmail.com>
2023-07-05 11:39:35 -04:00
3307bd200c Fixes syntax error on reports (#12997)
* fixes syntax error on reports #12842

* remove the extra filter #12842
2023-06-29 16:02:39 -04:00
6e222f8dce Closes #8248: User bookmarks (#13035)
* Initial work on #8248

* Add tests

* Fix tests

* Add feature query for bookmarks

* Add BookmarksWidget

* Correct generic relation name

* Add docs for bookmarks

* Remove inheritance from ChangeLoggedModel
2023-06-29 14:36:11 -04:00
f1858a7c23 Fixes #13011: Allow comma in custom links 2023-06-27 08:00:33 -04:00
290ffd408a Fixes #12977: Fix URL parameters for object count dashboard widgets (#12991)
* Fixes #12977: Introduce dict_to_querydict() to ensure proper handling of QueryDicts

* Remove unused import
2023-06-26 14:21:26 -04:00
1056e513b1 Closes #11541: Support for limiting tag assignments by object type (#12982)
* Initial work on #11541

* Merge migrations

* Limit tags by object type during assignment

* Add tests for object type validation

* Fix form field parameters
2023-06-23 14:08:14 -04:00
69b818ed33 12237 update to Django 4.2 / psycopg3 (#12916)
* 12237 upgrade django and psycopg

* 12237 add migration

* 12237 rename migration

* 12237 update requirements

* 12237 fix migration

* Update base requirements

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2023-06-23 10:38:08 -04:00
148278a74a 12591 config params admin (#12904)
* 12591 initial commit

* 12591 detail view

* 12591 add/edit view

* 12591 edit button

* 12591 base views and forms

* 12591 form cleanup

* 12591 form cleanup

* 12591 form cleanup

* 12591 review changes

* 12591 move check for restrictedqueryset

* 12591 restore view

* 12591 restore page styling

* 12591 remove admin

* Remove edit view for ConfigRevision instances

* Order ConfigRevisions by creation time

* Correct permission name

* Use RestrictedQuerySet for ConfigRevision

* Fix redirect URL

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2023-06-22 14:04:24 -04:00
518fd8cca6 12794 change User ref to get_user_model (#12905)
* 12794 change User ref to get_user_model

* 12794 call get_user_model once in tests

* 12794 call get_user_model once in tests

* 12794 use settings.AUTH_USER_MODEL for FK reference
2023-06-22 08:26:50 -04:00
e7edccd9ba Merge branch 'develop' into feature 2023-06-20 14:53:07 -04:00
93175888f0 add color to ChangeActionChoices #12828 2023-06-15 08:48:36 -04:00
e635f0defd Merge branch 'develop' into feature 2023-06-14 16:32:56 -07:00
b4a3156046 9077 audit alters_data=True 2023-06-14 14:23:55 -04:00
928a34674e change link parsing from quote_plus to quote #12822 2023-06-14 14:16:04 +05:30
bf1c191b2e Fixes #12694: Strip leading & trailing whitespace from custom link URL & text 2023-05-24 15:45:24 -04:00
21f4761335 12468 disallow double underscores in custom field names (#12523)
* 12468 disallow double underscores in custom field names

* 12468 disallow double underscores in custom field names

* 12468 review changes

* 12468 correct migration

* 12468 use inverse match

* 12468 use inverse match

* Add test for invalid custom field names

---------

Co-authored-by: jeremystretch <jstretch@netboxlabs.com>
2023-05-12 16:08:57 -04:00
9909213c0d 12416 warning for missing script file (#12456)
* 12416 warning for missing script file

* 12416 widen exception catching for internal script error

* Update netbox/extras/models/scripts.py

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>

* 12416 update from review feedback

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2023-05-05 09:37:38 -04:00
cc3b95bdb0 Fixes #12400: Validate default values for object and multi-object custom fields 2023-05-02 09:35:25 -04:00
6109bef700 Merge branch 'develop' into feature 2023-04-27 12:11:08 -04:00
4355085124 Fixes #12355: Exclude additional characters from url encode 2023-04-26 15:53:14 -07:00
f49e4ee512 Merge branch 'develop' into feature 2023-04-26 15:09:51 -04:00
89fa546a14 Merge pull request from GHSA-92x4-vfjf-rmf7 2023-04-21 15:08:04 -04:00
08017c51f6 Merge branch 'develop' into feature 2023-04-07 13:00:00 -04:00
94c2a2e56c 11746 fix delete custom field (#12092)
* 11746 delete custom field

* 11746 use filter instead of exclude
2023-04-04 16:38:48 -04:00
6a85c5b3ce Fixes #12115: Fix rendering config templates from a data file 2023-03-31 10:37:12 -04:00
fbc23424a6 Update models.py
Change default MIME-Type as discussed under #12095
2023-03-30 16:58:41 -04:00
715592547c #12081: Script & report cleanup (#12091)
* start() and terminate() methods on Job should call save()

* Fix display of associated jobs

* Introduce get_latest_jobs() method on JobsMixin

* Update messaging when no reports/scripts exist

* Catch ImportErrors when rendering report/script lists

* Fix loading of nested modules

* Fix URLs for nested scripts/reports
2023-03-29 16:51:55 -04:00
d2a694a878 Closes #12068: Establish a direct relationship from jobs to objects (#12075)
* Reference database object by GFK when running scripts & reports via UI

* Reference database object by GFK when running scripts & reports via API

* Remove old enqueue_job() method

* Enable filtering jobs by object

* Introduce ObjectJobsView

* Add tabbed views for report & script jobs

* Add object_id to JobSerializer

* Move generic relation to JobsMixin

* Clean up old naming
2023-03-28 15:47:09 -04:00
15590f1f48 Merge branch 'develop' into feature 2023-03-28 14:19:08 -04:00
a2c7452f90 12058 add clone to config context 2023-03-28 09:56:06 -04:00
654e32cbbe 11933 saved filters clone of content-types and add m2m field cloning (#12014)
* 11933 saved filters clone of content-types and add m2m field cloning

* Fix JSON rendering

* Add content_types to CustomLink.clone()

---------

Co-authored-by: jeremystretch <jstretch@netboxlabs.com>
2023-03-28 09:53:57 -04:00
879aabe2f9 12038 fix clone tag 2023-03-28 09:48:05 -04:00
835af32213 12008 make export templates cloneable 2023-03-28 09:45:44 -04:00
82080ef491 Remove the old JobResult model 2023-03-27 14:20:13 -04:00
40572b543f Rename JobResult to Job and move to core 2023-03-27 14:20:13 -04:00