Skip to content

Commit

Permalink
API (flatpages): allowed listing + allowed filtering by ID in additio…
Browse files Browse the repository at this point in the history
…n to URL
  • Loading branch information
JasonLovesDoggo committed Oct 2, 2023
1 parent 3283c25 commit a644cb1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions core/api/views/objects/flatpage.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,18 @@
class Serializer(serializers.ModelSerializer):
class Meta:
model = FlatPage
fields = "__all__"
exclude = [
"sites",
"enable_comments",
"template_name",
] # fields = all - sites, enable_comments, template_name


class FlatPageProvider(BaseProvider):
serializer_class = Serializer
model = FlatPage
allow_list = False
lookup_fields = ["url"]
allow_list = True
lookup_fields = ["id", "url"]

@property
def permission_classes(self):
Expand Down

0 comments on commit a644cb1

Please sign in to comment.