class NotebookSerializerMixin(object):

    def get_notebook(self, obj):
        return obj.notebook.id if obj.tensorboard else None

class NotebookSerializerMixin(object):

    def get_notebook(self, obj):
        return obj.notebook.id if obj.notebook else None

Fix typo in serializer