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
Exemple #2
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
    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
Exemple #4
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