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

1.9rc1 regression in Block.render() #3346

Closed
mvantellingen opened this issue Feb 8, 2017 · 1 comment
Closed

1.9rc1 regression in Block.render() #3346

mvantellingen opened this issue Feb 8, 2017 · 1 comment
Milestone

Comments

@mvantellingen
Copy link
Member

The Block.render() (see

def render(self, value, context=None):
) accepts an optional context however a few lines below (
new_context.update(self.get_context(value))
) it is assumed that it is a dictionary.

We hit this issue since we implemented a get_context() override on a subclass of a blocks.StructBlock. Adding the parent_context kwarg and passing it down works the issue.

cc @mikedebock

mvantellingen added a commit to mvantellingen/wagtail that referenced this issue Feb 8, 2017
If ``Block.get_context()`` was overriden without accepting the
``parent_context`` kwarg the fallback handling threw an exception if
``context`` was None.

See wagtail#3346
@gasman gasman added this to the 1.9 milestone Feb 8, 2017
gasman pushed a commit that referenced this issue Feb 8, 2017
If ``Block.get_context()`` was overriden without accepting the
``parent_context`` kwarg the fallback handling threw an exception if
``context`` was None.

See #3346
gasman pushed a commit that referenced this issue Feb 8, 2017
If ``Block.get_context()`` was overriden without accepting the
``parent_context`` kwarg the fallback handling threw an exception if
``context`` was None.

See #3346
@gasman
Copy link
Collaborator

gasman commented Feb 8, 2017

Fixed in #3347

@gasman gasman closed this as completed Feb 8, 2017
trumpet2012 pushed a commit to morris-tech/wagtail that referenced this issue Feb 21, 2017
If ``Block.get_context()`` was overriden without accepting the
``parent_context`` kwarg the fallback handling threw an exception if
``context`` was None.

See wagtail#3346
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

2 participants