Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Wagtail] Correction du chargement des pages statiques #1035

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions lemarche/cms/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@ class ArticlePage(Page):
blank=True, verbose_name="Contenu de l'article", features=settings.WAGTAIL_RICHTEXT_FIELD_FEATURES
)

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
# Override template file for static pages
def get_template(self, request, *args, **kwargs):
if self.is_static_page:
self.template = f"cms/static/{self.template_name}"
return f"cms/static/{self.template_name}"
else:
return super().get_template(request, *args, **kwargs)

base_form_class = ArticlePageForm

Expand Down
2 changes: 1 addition & 1 deletion lemarche/tenders/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ def test_with_siae_stats(self):
self.assertEqual(tender_with_siae_1.siae_email_send_count_annotated, 5)
self.assertEqual(tender_with_siae_1.siae_email_link_click_count_annotated, 4)
self.assertEqual(tender_with_siae_1.siae_detail_display_count_annotated, 2)
self.assertEqual(tender_with_siae_1.siae_email_link_click_or_detail_display_count_annotated, 2)
self.assertEqual(tender_with_siae_1.siae_email_link_click_or_detail_display_count_annotated, 4)
self.assertEqual(tender_with_siae_1.siae_detail_contact_click_count_annotated, 1)
self.assertEqual(tender_with_siae_1.siae_detail_cocontracting_click_count_annotated, 1)
self.assertEqual(tender_with_siae_1.siae_detail_contact_click_since_last_seen_date_count_annotated, 1)
Expand Down