(self, sketch_id, graph_id)
return HTTP_STATUS_CODE_OK
Handles DELETE request to the resource.

        Args:
            sketch_id: Integer primary key for a sketch database model
            graph_id: Integer primary key for a graph database model
Handles DELETE request to the resource.
Handles DELETE request to the resource .
def delete(self, sketch_id, graph_id):
        """Handles DELETE request to the resource.

        Args:
            sketch_id: Integer primary key for a sketch database model
            graph_id: Integer primary key for a graph database model
        """
        sketch = Sketch.query.get_with_acl(sketch_id)
        graph = Graph.query.get(graph_id)

        if not graph:
            msg = 'No Graph found with this ID.'
            abort(HTTP_STATUS_CODE_NOT_FOUND, msg)

        if not sketch:
            msg = 'No sketch found with this ID.'
            abort(HTTP_STATUS_CODE_NOT_FOUND, msg)

        # Check that this graph belongs to the sketch
        if graph.sketch.id != sketch.id:
            msg = (
                f'The sketch ID ({sketch.id}) does not match with the story'
                f'sketch ID ({graph.sketch.id})')
            abort(HTTP_STATUS_CODE_FORBIDDEN, msg)

        if not sketch.has_permission(user=current_user, permission='write'):
            abort(
                HTTP_STATUS_CODE_FORBIDDEN,
                'The user does not have write permission on the sketch.')

        sketch.graphs.remove(graph)
        db_session.commit()

        # Update the last activity of a sketch.
        utils.update_sketch_last_activity(sketch)

        return HTTP_STATUS_CODE_OK
def delete ( self , sketch_id , graph_id ) : sketch = Sketch . query . get_with_acl ( sketch_id ) graph = Graph . query . get ( graph_id ) if not graph : msg = 'No Graph found with this ID.' abort ( HTTP_STATUS_CODE_NOT_FOUND , msg ) if not sketch : msg = 'No sketch found with this ID.' abort ( HTTP_STATUS_CODE_NOT_FOUND , msg ) # Check that this graph belongs to the sketch if graph . sketch . id != sketch . id : msg = ( f'The sketch ID ({sketch.id}) does not match with the story' f'sketch ID ({graph.sketch.id})' ) abort ( HTTP_STATUS_CODE_FORBIDDEN , msg ) if not sketch . has_permission ( user = current_user , permission = 'write' ) : abort ( HTTP_STATUS_CODE_FORBIDDEN , 'The user does not have write permission on the sketch.' ) sketch . graphs . remove ( graph ) db_session . commit ( ) # Update the last activity of a sketch. utils . update_sketch_last_activity ( sketch ) return HTTP_STATUS_CODE_OK