Protect clear_vote when trial_run is in effect

master^2
David John 7 years ago
parent 8f0087e5c7
commit 772df35c68

@ -130,11 +130,12 @@ class Shredder(object):
def _remove(self, item): def _remove(self, item):
if self._keep_a_copy and self._save_directory: if self._keep_a_copy and self._save_directory:
self._save_item(item) self._save_item(item)
if self._clear_vote: if not self._trial_run:
try: if self._clear_vote:
item.clear_vote() try:
except BadRequest: item.clear_vote()
self._logger.debug("Couldn't clear vote on {item}".format(item=item)) except BadRequest:
self._logger.debug("Couldn't clear vote on {item}".format(item=item))
if isinstance(item, Submission): if isinstance(item, Submission):
self._remove_submission(item) self._remove_submission(item)
elif isinstance(item, Comment): elif isinstance(item, Comment):

Loading…
Cancel
Save