瀏覽代碼

9856 cleanup

Arthur 1 年之前
父節點
當前提交
3b30aa965f
共有 1 個文件被更改,包括 3 次插入4 次删除
  1. 3 4
      netbox/extras/graphql/types.py

+ 3 - 4
netbox/extras/graphql/types.py

@@ -129,19 +129,18 @@ class CustomFieldType(ObjectType):
 
 
 @strawberry_django.type(
 @strawberry_django.type(
     models.CustomFieldChoiceSet,
     models.CustomFieldChoiceSet,
-    fields='__all__',
+    exclude=('extra_choices', ),
     filters=CustomFieldChoiceSetFilter
     filters=CustomFieldChoiceSetFilter
 )
 )
 class CustomFieldChoiceSetType(ObjectType):
 class CustomFieldChoiceSetType(ObjectType):
-    extra_choices: List[List[str]]
 
 
     @strawberry_django.field
     @strawberry_django.field
     def choices_for(self) -> List[Annotated["CustomFieldType", strawberry.lazy('extras.graphql.types')]]:
     def choices_for(self) -> List[Annotated["CustomFieldType", strawberry.lazy('extras.graphql.types')]]:
         return self.choices_for.all()
         return self.choices_for.all()
 
 
     @strawberry_django.field
     @strawberry_django.field
-    def extra_choices(self) -> List[str]:
-        return self.extra_choices
+    def extra_choices(self) -> List[str] | None:
+        return list(self.extra_choices)
 
 
 
 
 @strawberry_django.type(
 @strawberry_django.type(