[Zope] Sessions & DTML Execution
justin.dunsworth at gmail.com
Wed Apr 8 14:25:09 CEST 2015
I am running into an issue that I can't quite figure out.
I'm trying to leverage storing data within sessions then setting a variable
in the header of my page to the session variable (for ease of calling)
where I can then use it throughout the rest of my document. Here's the way
Here I am wanting to redirect to login should testVarDict not be set.
Instead it seems like Zope is still wanting to execute the rest of the page
prior to redirecting so this will throw a NameError for testVarDict should
the session data not be set.
I then found out that I can change the dtml-call to a dtml-return for the
redirect and it will stop executing the dtml and redirect. This is all fine
but if I have another page I'm going to call that uses the header like so:
This then will throw the same NameError regardless of the dtml-return
redirect in the header. I can get around this by placing the same checks in
the top of every.single.page that I want to utilize testVarDict variable
but that's too cumbersome.
I then tried to make a script that would check the same thing and then
redirect but it doesn't seem to work at all - for fun here's the python
I've also tried just the context.REQUEST.RESPONSE.redirect without the
return but it doesn't seem to work and I suspect it's because python return
is not the same as dtml-return.
If anyone could assist or show me a different way then I would greatly
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Zope