Fix calling len() on singular Submission / Comment instances.

This commit is contained in:
Ethan Dalool 2017-12-05 08:31:14 -08:00
parent d1e68a0816
commit 6b4b6040be

View file

@ -203,9 +203,9 @@ class TSDB:
return cls(filepath=filepath, do_create=do_create)
def insert(self, objects, commit=True):
common.log.debug('Trying to insert %d objects.', len(objects))
if not isinstance(objects, (list, tuple, types.GeneratorType)):
objects = [objects]
common.log.debug('Trying to insert %d objects.', len(objects))
new_values = {
'new_submissions': 0,