Skip to content
Snippets Groups Projects
Commit 9646fa9e authored by Todd Dembrey's avatar Todd Dembrey
Browse files

Provide the parent page of the round on the object before the save

parent e77d60b3
No related branches found
No related tags found
No related merge requests found
......@@ -143,7 +143,7 @@ class Round(AbstractStreamForm):
Q(end_date__gte=self.start_date)
)
conflicting_rounds = Round.objects.sibling_of(self).filter(
conflicting_rounds = Round.objects.child_of(self.parent_page).filter(
conflict_query
).exclude(id=self.id)
......
from wagtail.wagtailcore import hooks
from wagtail.contrib.modeladmin.options import modeladmin_register
from .admin import ApplyAdminGroup
from .models import Round
modeladmin_register(ApplyAdminGroup)
@hooks.register('before_create_page')
def before_create_page(request, parent_page, page_class):
if page_class == Round:
page_class.parent_page = parent_page
return page_class
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment