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

Conflict with mezzanine.pages.middleware.PageMiddleware #8

Closed
nkeilar opened this issue Jun 16, 2013 · 2 comments
Closed

Conflict with mezzanine.pages.middleware.PageMiddleware #8

nkeilar opened this issue Jun 16, 2013 · 2 comments

Comments

@nkeilar
Copy link

nkeilar commented Jun 16, 2013

TypeError at /collaborate/individuals/
page() takes at least 2 arguments (2 given)

at mezzanine/pages/middleware.py in process_view, line 80

Basically, the middleware trying to do some fancy checking - this includes resolving some possible url options. While its failing for some other reason, I believe even if it was passing, there is going to be a recursion problem.

@nkeilar
Copy link
Author

nkeilar commented Jun 16, 2013

Sorry. This probably doesn't belong here.

@nkeilar nkeilar closed this as completed Jun 16, 2013
@nkeilar
Copy link
Author

nkeilar commented Jun 16, 2013

Also requires overriding PageMiddleware

# Handle ``page.login_required``.
        if page.login_required and not request.user.is_authenticated():
            path = urlquote(request.get_full_path())
            bits = (settings.LOGIN_URL, REDIRECT_FIELD_NAME, path)
            return redirect("%s?%s=%s" % bits)

        if (page.slug == slug and view_func == page_view) or (page.slug == slug and view_func.func_name == 'multiview'): << this line
            # Add the page to the ``extra_context`` arg for the
            # page view, which is responsible for choosing which
            # template to use, and raising 404 if there's no page
            # instance loaded.
            view_kwargs.setdefault("extra_context", {})
            view_kwargs["extra_context"]["page"] = page

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant