Skip to content

Commit

Permalink
Black format
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit Vermeulen committed Feb 8, 2024
1 parent b634ce8 commit cc10308
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions home/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -983,6 +983,7 @@ def update_embedding(sender, instance, *args, **kwargs):

instance.embedding = embedding


class OrderedContentSet(DraftStateMixin, RevisionMixin, index.Indexed, models.Model):
revisions = GenericRelation(
"wagtailcore.Revision", related_query_name="orderedcontentset"
Expand Down
2 changes: 2 additions & 0 deletions home/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,7 @@ def test_orderedcontent_endpoint_with_drafts(self, uclient):
"profile_field": "gender",
"value": "female",
}

def test_orderedcontent_endpoint_without_drafts(self, uclient):
"""
Unpublished ordered content sets are not returned if the qa param is not set.
Expand Down Expand Up @@ -677,6 +678,7 @@ def test_orderedcontent_detail_endpoint_without_drafts(self, uclient):
# it redirects :TODO is it possible to resolve the redirect?
assert response.status_code == 301


@pytest.mark.django_db
class TestContentPageAPI2:
"""
Expand Down
2 changes: 2 additions & 0 deletions home/wagtail_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
ContentUploadView,
)


@hooks.register("register_admin_urls")
def register_import_urls():
return [
Expand Down Expand Up @@ -207,6 +208,7 @@ def num_pages(self, obj):

num_pages.short_description = "Number of Pages"


register_snippet(OrderedContentSetViewSet)
# Now you just need to register your customised ModelAdmin class with Wagtail
modeladmin_register(ContentPageAdmin)

0 comments on commit cc10308

Please sign in to comment.