Update PostType and PostTagType field definitions
Replaced `fields = "__all__"` with specific fields for better control and security. Removed unused `filter_fields` to clean up the code and align with actual requirements. These changes improve maintainability and clarity.
This commit is contained in:
parent
68febcdb08
commit
bbde0a4654
1 changed files with 1 additions and 3 deletions
|
|
@ -11,9 +11,8 @@ class PostType(DjangoObjectType):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Post
|
model = Post
|
||||||
fields = "__all__"
|
fields = ["tags", "content", "title", "slug"]
|
||||||
interfaces = (relay.Node,)
|
interfaces = (relay.Node,)
|
||||||
filter_fields = ["is_active"]
|
|
||||||
|
|
||||||
def resolve_content(self, info):
|
def resolve_content(self, info):
|
||||||
return self.content.html.replace("\n", "<br/>")
|
return self.content.html.replace("\n", "<br/>")
|
||||||
|
|
@ -24,4 +23,3 @@ class PostTagType(DjangoObjectType):
|
||||||
model = PostTag
|
model = PostTag
|
||||||
fields = "__all__"
|
fields = "__all__"
|
||||||
interfaces = (relay.Node,)
|
interfaces = (relay.Node,)
|
||||||
filter_fields = ["is_active"]
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue