try:
    from functools import wraps
except ImportError:
    from django.utils.functional import wraps

from feincms.models import Page


def add_page_to_extra_context(view_func):
    def inner(request, *args, **kwargs):
        kwargs.setdefault('extra_context', {})
        kwargs['extra_context']['feincms_page'] = Page.objects.best_match_for_path(request.path)

        return view_func(request, *args, **kwargs)
    return wraps(view_func)(inner)


try:
    from functools import wraps
except ImportError:
    from django.utils.functional import wraps

from feincms.models import Page


def add_page_to_extra_context(view_func):
    def inner(request, *args, **kwargs):
        kwargs.setdefault('extra_context', {})
        kwargs['extra_context']['feincms_page'] = Page.objects.best_match_from_request(request)

        return view_func(request, *args, **kwargs)
    return wraps(view_func)(inner)


Call the setup_request page method too in generic views replacements
Call the setup_request page method too in generic views replacements

  try:
      from functools import wraps
  except ImportError:
      from django.utils.functional import wraps
  
  from feincms.models import Page
  
  
  def add_page_to_extra_context(view_func):
      def inner(request, *args, **kwargs):
          kwargs.setdefault('extra_context', {})
-         kwargs['extra_context']['feincms_page'] = Page.objects.best_match_for_path(request.path)
+         kwargs['extra_context']['feincms_page'] = Page.objects.best_match_from_request(request)
  
          return view_func(request, *args, **kwargs)
      return wraps(view_func)(inner)
  
  
Call the setup_request page method too in generic views replacements
## Code Before:
try:
    from functools import wraps
except ImportError:
    from django.utils.functional import wraps

from feincms.models import Page


def add_page_to_extra_context(view_func):
    def inner(request, *args, **kwargs):
        kwargs.setdefault('extra_context', {})
        kwargs['extra_context']['feincms_page'] = Page.objects.best_match_for_path(request.path)

        return view_func(request, *args, **kwargs)
    return wraps(view_func)(inner)


## Instruction:
Call the setup_request page method too in generic views replacements
## Code After:
try:
    from functools import wraps
except ImportError:
    from django.utils.functional import wraps

from feincms.models import Page


def add_page_to_extra_context(view_func):
    def inner(request, *args, **kwargs):
        kwargs.setdefault('extra_context', {})
        kwargs['extra_context']['feincms_page'] = Page.objects.best_match_from_request(request)

        return view_func(request, *args, **kwargs)
    return wraps(view_func)(inner)

