From c9996fd65818eac48627f182a43e604d6a0e9d94 Mon Sep 17 00:00:00 2001 From: Oleg Silkin Date: Tue, 30 Jul 2019 00:23:15 -0400 Subject: [PATCH] Enables comment deletion --- src/server/app.py | 1 - src/server/database.py | 2 +- src/server/handles.py | 3 +-- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/server/app.py b/src/server/app.py index 49c0abc..22c73d3 100644 --- a/src/server/app.py +++ b/src/server/app.py @@ -1,7 +1,6 @@ # cython: language_level=3 import logging import pathlib -import re import signal import time diff --git a/src/server/database.py b/src/server/database.py index 9bbbd79..68a478d 100644 --- a/src/server/database.py +++ b/src/server/database.py @@ -194,8 +194,8 @@ class DatabaseWriter(object): def cleanup(self): logging.info('Cleaning up database writer') - DatabaseWriter._writer = None self.conn.close() + DatabaseWriter._writer = None @property def connection(self): diff --git a/src/server/handles.py b/src/server/handles.py index 690eaa6..b28ab02 100644 --- a/src/server/handles.py +++ b/src/server/handles.py @@ -10,7 +10,6 @@ from src.server.misc import clean_input_params from src.server.database import get_claim_comments from src.server.database import get_comments_by_id, get_comment_ids from src.server.database import get_channel_id_from_comment_id -from src.server.database import obtain_connection from src.server.misc import is_valid_base_comment from src.server.misc import is_valid_credential_input from src.server.misc import make_error @@ -63,7 +62,7 @@ METHODS = { 'get_comments_by_id': handle_get_comments_by_id, 'get_channel_from_comment_id': handle_get_channel_from_comment_id, 'create_comment': handle_create_comment, - # 'delete_comment': handle_delete_comment, + 'delete_comment': handle_delete_comment, # 'abandon_comment': handle_delete_comment, }