[Grok-dev] Unauthorized, but only on the upgraded Grok project (bug in 1.0b2?)
Jan-Wijbrand Kolman
janwijbrand at gmail.com
Tue Oct 6 03:44:11 EDT 2009
Sebastian Ware wrote:
> I have reinstalled my project on the production server with grok 1.0a4
> and it works fine so I guess I need to configure something differently
> for grok 1.0b2 to work. But since I made a fresh grokproject I don't
> see what I need to change.
snip
>>> class Login(grok.View):
>>> grok.context(ProtonCMS)
>>> title = 'Logga in'
>>>
>>> referer = None
>>>
>>> def update(self, login_submit=None, login=None):
>>> # XXX: need to display some kind of feedback when the login
>>> fails
>>> self.the_url, self.the_args = self.get_url_and_args()
>>> if (not
>>> IUnauthenticatedPrincipal.providedBy(self.request.principal)
>>> and login_submit is not None):
>>> destination = self.request.get('referer')
>>> if not destination:
>>> destination = self.url(grok.getSite()) + '/default/
>>> workflow'
>>> else:
>>> destination = unquote(destination)
>>> self.redirect(destination)
>>> else:
>>> if self.the_args.has_key('camefrom'):
>>> self.referer = self.the_args['camefrom']
>>>
>>> Any ideas?
Could you test this again with a grok.require('zope.Public') on your
Login view class?
>>> class Login(grok.View):
... grok.require('zope.Public')
... grok.context(ProtonCMS)
... title = 'Logga in'
...
If that does work, I think I know what went wrong (and then it is also
clearly a documentation bug then).
Regards,
jw
More information about the Grok-dev
mailing list