Skip to content

Commit

Permalink
Fix serving the variant pages
Browse files Browse the repository at this point in the history
  • Loading branch information
mvantellingen committed May 31, 2017
1 parent cf81011 commit 8465e6d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/wagtail_personalisation/wagtail_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,11 @@ def serve_variation(page, request, serve_args, serve_kwargs):

if user_segments:
metadata = page.personalisable_metadata

# TODO: This is never more then one page? (fix query count)
variations = metadata.variants_for_segments(user_segments)
if variations:
variation = variations.first()
impersonate_other_page(variation, page)
variation = variations.first().variant.specific
return variation.serve(request, *serve_args, **serve_kwargs)


Expand Down

0 comments on commit 8465e6d

Please sign in to comment.