Ignore:
Timestamp:
Dec 20, 2009, 9:45:18 PM (14 years ago)
Author:
broder
Message:

Write handler for create form, and consolidate code to require POST into a CherryPy? tool

File:
1 edited

Legend:

Unmodified
Added
Removed
  • package_branches/invirt-web/cherrypy-rebased/code/view.py

    r2673 r2685  
    8383cherrypy.tools.require_login = cherrypy.Tool('on_start_resource', require_login, priority=150)
    8484
     85def require_POST():
     86    """If the request isn't a POST request, raise 405 Method Not Allowed"""
     87    if cherrypy.request.method != "POST":
     88        raise cherrypy.HTTPError(405,
     89                                 "You must submit this request with POST")
     90
     91cherrypy.tools.require_POST = cherrypy.Tool('on_start_resource', require_POST, priority=150)
     92
    8593def remote_user_login():
    8694    """Get the current user based on the SSL or GSSAPI environment variables"""
Note: See TracChangeset for help on using the changeset viewer.