Iterate while things were removed, combat the max 100 issue.

pull/38/head
David Trail 10 years ago
parent 273d115359
commit 9b1c0663f8

@ -121,6 +121,7 @@ def get_things(after=None):
raise Exception("Your deletion section is wrong") raise Exception("Your deletion section is wrong")
def remove_things(things): def remove_things(things):
removal_count = 0
for thing in things: for thing in things:
# Seems to be in users's timezone. Unclear. # Seems to be in users's timezone. Unclear.
thing_time = datetime.fromtimestamp(thing.created_utc) thing_time = datetime.fromtimestamp(thing.created_utc)
@ -186,7 +187,12 @@ def remove_things(things):
thing.edit(replacement_text) thing.edit(replacement_text)
if not edit_only: if not edit_only:
thing.delete() thing.delete()
removal_count == 1
return removal_count
things = get_things() things = get_things()
remove_things(things) count = remove_things(things)
while count != 0:
things = get_things()
count = remove_things(things)

Loading…
Cancel
Save