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

9856 review changes

This commit is contained in:
Arthur
2024-03-19 10:04:33 -07:00
parent 9c29f45c1a
commit b75b9e01eb
17 changed files with 224 additions and 226 deletions

View File

@@ -451,12 +451,12 @@ class APIViewTestCases:
# Compile list of fields to include
fields_string = ''
file_fields = (strawberry_django.fields.types.DjangoFileType, strawberry_django.fields.types.DjangoImageType)
for field in type_class.__strawberry_definition__.fields:
if (
field.type in (
strawberry_django.fields.types.DjangoFileType, strawberry_django.fields.types.DjangoImageType) or
type(field.type) is StrawberryOptional and field.type.of_type in (
strawberry_django.fields.types.DjangoFileType, strawberry_django.fields.types.DjangoImageType)
field.type in file_fields or (
type(field.type) is StrawberryOptional and field.type.of_type in file_fields
)
):
# image / file fields nullable or not...
fields_string += f'{field.name} {{ name }}\n'