Fix show placeholder sekizai #1596

Merged
merged 6 commits into from Jan 21, 2013

5 participants

@ojii

Cache (and restore) sekizai changes done during _show_placeholder_for_page. This fixes #1577.

Bumps the dependency of django-sekizai to 0.7.

@digi604
Divio AG member

it seams python below 2.7 does not have assertIn ... see tests

@ojii

ugh. sorry about that. I'll backport it.

@ojii

should be fixed now, as django backports unittest2

@adaptivelogic adaptivelogic commented on the diff Jan 18, 2013
cms/templatetags/cms_tags.py
@@ -368,6 +369,12 @@ def get_context(self, context, cl, spec):
return {'title': spec.title(), 'choices': unique_choices}
+def _restore_sekizai(context, changes):

If (as it appears) context[get_varname()] is constant in the loop, maybe store it in a variable?

@ojii
ojii added a note Jan 18, 2013

it's a very cheap lookup, but you're right.

I meant to store context[get_varname()] itself, but it's a nitpick.

@ojii
ojii added a note Jan 18, 2013

ah, reading is hard... will fix that , and also do the [key] lookup only once

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@adaptivelogic

Looks good to me.

@digi604 digi604 merged commit 5a03060 into divio:develop Jan 21, 2013

1 check passed

Details default The Travis build passed
@yakky

Any plan to fix this in 2.3.x too?
I can take care of backporting it

@coveralls

Coverage Status

Changes Unknown when pulling ecd464d on ojii:fix-show-placeholder-sekizai into ** on divio:develop**.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment