Changeset 5519

Show
Ignore:
Timestamp:
10/06/08 15:34:31 (3 months ago)
Author:
faide
Message:

Fixed SecureController? implementation so that repoze.who now
proposes the config specified form (or other method) instead
of returning a violent 404... :) Stupid me it was simple...
My brain was fried on the day I coded this!

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/tg/controllers.py

    r5152 r5519  
    2020import pylons 
    2121from pylons.controllers import WSGIController 
    22 from pylons.controllers.util import abort 
    2322 
    2423from tg.exceptions import (HTTPFound, HTTPNotFound, HTTPException,  
     
    2726from tg.render import render as tg_render 
    2827from tw.api import Widget 
    29 from webob.exc import HTTPForbidden 
     28from webob.exc import HTTPUnauthorized 
    3029 
    3130log = logging.getLogger(__name__) 
     
    410409 
    411410        # identity error should be treated separatly from "not found" errors 
    412         except HTTPForbidden, httpe: 
    413             log.debug("a 403 error occured for obj: %s" % obj) 
     411        except HTTPUnauthorized, httpe: 
     412            log.debug("a 401 error occured for obj: %s" % obj) 
    414413            raise 
    415414 
     
    467466    if hasattr(klass_instance, "check_security"): 
    468467        if not klass_instance.check_security(): 
    469             raise HTTPForbidden().exception 
    470             #abort(403) 
     468            raise HTTPUnauthorized().exception 
    471469 
    472470def _iscontroller(obj):