(self, sketch_id)
return HTTP_STATUS_CODE_OK
Handles DELETE request to the resource.
Handles DELETE request to the resource.
Handles DELETE request to the resource .
def delete(self, sketch_id):
        """Handles DELETE request to the resource."""
        sketch = Sketch.query.get_with_acl(sketch_id)
        if not sketch:
            abort(
                HTTP_STATUS_CODE_NOT_FOUND, 'No sketch found with this ID.')
        if not sketch.has_permission(current_user, 'delete'):
            abort(
                HTTP_STATUS_CODE_FORBIDDEN, (
                    'User does not have sufficient access rights to '
                    'delete a sketch.'))
        not_delete_labels = current_app.config.get(
            'LABELS_TO_PREVENT_DELETION', [])
        for label in not_delete_labels:
            if sketch.has_label(label):
                abort(
                    HTTP_STATUS_CODE_FORBIDDEN,
                    'Sketch with the label [{0:s}] cannot be deleted.'.format(
                        label))
        sketch.set_status(status='deleted')
        return HTTP_STATUS_CODE_OK
def delete ( self , sketch_id ) : sketch = Sketch . query . get_with_acl ( sketch_id ) if not sketch : abort ( HTTP_STATUS_CODE_NOT_FOUND , 'No sketch found with this ID.' ) if not sketch . has_permission ( current_user , 'delete' ) : abort ( HTTP_STATUS_CODE_FORBIDDEN , ( 'User does not have sufficient access rights to ' 'delete a sketch.' ) ) not_delete_labels = current_app . config . get ( 'LABELS_TO_PREVENT_DELETION' , [ ] ) for label in not_delete_labels : if sketch . has_label ( label ) : abort ( HTTP_STATUS_CODE_FORBIDDEN , 'Sketch with the label [{0:s}] cannot be deleted.' . format ( label ) ) sketch . set_status ( status = 'deleted' ) return HTTP_STATUS_CODE_OK