mirror of
https://github.com/netbox-community/netbox.git
synced 2025-12-26 07:07:46 -06:00
Closes #15238: Include description field in brief mode
This commit is contained in:
@@ -103,7 +103,7 @@ class TokenSerializer(ValidatedModelSerializer):
|
||||
'id', 'url', 'display', 'user', 'created', 'expires', 'last_used', 'key', 'write_enabled', 'description',
|
||||
'allowed_ips',
|
||||
)
|
||||
brief_fields = ('id', 'url', 'display', 'key', 'write_enabled')
|
||||
brief_fields = ('id', 'url', 'display', 'key', 'write_enabled', 'description')
|
||||
|
||||
def to_internal_value(self, data):
|
||||
if 'key' not in data:
|
||||
@@ -184,4 +184,6 @@ class ObjectPermissionSerializer(ValidatedModelSerializer):
|
||||
'id', 'url', 'display', 'name', 'description', 'enabled', 'object_types', 'groups', 'users', 'actions',
|
||||
'constraints',
|
||||
)
|
||||
brief_fields = ('id', 'url', 'display', 'name', 'enabled', 'object_types', 'groups', 'users', 'actions')
|
||||
brief_fields = (
|
||||
'id', 'url', 'display', 'name', 'description', 'enabled', 'object_types', 'groups', 'users', 'actions',
|
||||
)
|
||||
|
||||
@@ -129,7 +129,7 @@ class TokenTest(
|
||||
APIViewTestCases.DeleteObjectViewTestCase
|
||||
):
|
||||
model = Token
|
||||
brief_fields = ['display', 'id', 'key', 'url', 'write_enabled']
|
||||
brief_fields = ['description', 'display', 'id', 'key', 'url', 'write_enabled']
|
||||
bulk_update_data = {
|
||||
'description': 'New description',
|
||||
}
|
||||
@@ -241,7 +241,9 @@ class ObjectPermissionTest(
|
||||
APIViewTestCases.DeleteObjectViewTestCase
|
||||
):
|
||||
model = ObjectPermission
|
||||
brief_fields = ['actions', 'display', 'enabled', 'groups', 'id', 'name', 'object_types', 'url', 'users']
|
||||
brief_fields = [
|
||||
'actions', 'description', 'display', 'enabled', 'groups', 'id', 'name', 'object_types', 'url', 'users',
|
||||
]
|
||||
|
||||
@classmethod
|
||||
def setUpTestData(cls):
|
||||
|
||||
Reference in New Issue
Block a user