Protect clear_vote when trial_run is in effect

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

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

Loading…
Cancel
Save