[Grok-dev] Unauthorized, but only on the upgraded Grok project (bug in 1.0b2?)

Sebastian Ware sebastian at urbantalk.se
Tue Oct 6 04:02:39 EDT 2009


Problem solved with:

> grok.require('zope.Public')

Mvh Sebastian

On 6 okt 2009, at 09.44, Jan-Wijbrand Kolman wrote:

> 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
>
> _______________________________________________
> Grok-dev mailing list
> Grok-dev at zope.org
> https://mail.zope.org/mailman/listinfo/grok-dev



More information about the Grok-dev mailing list