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

Password protected entries have an incomplete context #553

Open
3 tasks done
adongy opened this issue Dec 20, 2018 · 1 comment
Open
3 tasks done

Password protected entries have an incomplete context #553

adongy opened this issue Dec 20, 2018 · 1 comment

Comments

@adongy
Copy link

adongy commented Dec 20, 2018

When setting a password on an entry, you go through the EntryProtectionMixin
, which renders an intermediate view (password). It uses an extra context attribute to render properly (namely, was the password correct). Hoever, it completely overrides the context, making all your context processors missing.

Actual behavior

Missing context values. It ends up as

context = [{'True': True, 'False': False, 'None': None}, {}, {}, {'error': False}]

Expected behavior

We have access to the whole context in the password view, with an extra attribute called "error".

Steps to reproduce the issue

  1. Create en entry with a password
  2. Try to access something provided by context processors in the template that is not error
  3. Get a KeyError

Specifications

  • Zinnia version: django-blog-zinnia==0.20
  • Django version: Django==2.1
  • Python version: Python 3.7.1
  • Operating system: macOS

Disclaimer

Before submitting an issue make sure you have:

  • Read the guidelines for contributing.
  • Checked for duplicate issues.
  • Not a support request.
@adongy
Copy link
Author

adongy commented Dec 20, 2018

A suggested fix it to use the standard get_context_data and add the error attribute there. I can submit a PR if needed.

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