durusmail: quixote-users: atomic form token tests
atomic form token tests
2002-09-04
atomic form token tests
Neil Schemenauer
2002-09-04
On Wed, Sep 04, 2002 at 11:06:26AM -0600, Jonathan Corbet wrote:
> The one thing that might be worth doing is providing an interface that
> implements the "atomic test and clear" operation.  That could be as
> simple as having the remove_form_token session method return a value
> saying whether it *really* removed a token or not.

Is this what you are thinking of:

    if not request.session.remove_form_token(token):
        

instead of:

    if not request.session.has_form_token(token):
        
    else:
        request.session.remove_form_token(token)

If so, that seems like a good idea.

  Neil


reply