コード例 #1
0
    def delete_license(self, license_id, return_to=None, **kwargs):
        '''
        Deletes a specific license
        '''

        template_args = {
            'return_to': util.make_url_internal(return_to),
            'was_deleted': False
        }

        try:
            # first check that the license is valid
            marked_license = License.get(License.build_id(
                license_id,
                namespace=None,
                owner=None
            ))
            template_args['license'] = marked_license

            # handle delete
            if cherrypy.request.method == 'POST':
                marked_license.delete()
                template_args['was_deleted'] = True
            
        except Exception, e:
            template_args['controller_exception'] = e
コード例 #2
0
ファイル: licensing.py プロジェクト: linearregression/splunk
    def view_license(self, license_name, **kw):
        '''
        Handles the license view page
        '''

        template_args = {'license_name': license_name, 'license': None}

        try:
            # first check that the license is valid
            license_object = License.get(
                License.build_id(license_name, namespace=None, owner=None))
            template_args['license'] = license_object

        except Exception, e:
            template_args['controller_exception'] = e
コード例 #3
0
    def view_license(self, license_name, **kw):
        '''
        Handles the license view page
        '''

        template_args = {
            'license_name': license_name,
            'license': None
        }

        try:
            # first check that the license is valid
            license_object = License.get(License.build_id(
                license_name,
                namespace=None,
                owner=None
            ))
            template_args['license'] = license_object

        except Exception, e:
            template_args['controller_exception'] = e
コード例 #4
0
ファイル: licensing.py プロジェクト: linearregression/splunk
    def delete_license(self, license_id, return_to=None, **kwargs):
        '''
        Deletes a specific license
        '''

        template_args = {
            'return_to': util.make_url_internal(return_to),
            'was_deleted': False
        }

        try:
            # first check that the license is valid
            marked_license = License.get(
                License.build_id(license_id, namespace=None, owner=None))
            template_args['license'] = marked_license

            # handle delete
            if cherrypy.request.method == 'POST':
                marked_license.delete()
                template_args['was_deleted'] = True

        except Exception, e:
            template_args['controller_exception'] = e