From: Jacob Hilker Date: Thu, 23 Jan 2014 00:45:49 +0000 (-0500) Subject: update sanitize_usde_schools.py to not require confirmation for sanitization X-Git-Tag: release-20150131~219^2 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=refs%2Fpull%2F299%2Fhead;p=oweals%2Fkarmaworld.git update sanitize_usde_schools.py to not require confirmation for sanitization --- diff --git a/karmaworld/apps/courses/management/commands/sanitize_usde_schools.py b/karmaworld/apps/courses/management/commands/sanitize_usde_schools.py index 119e420..c75a410 100644 --- a/karmaworld/apps/courses/management/commands/sanitize_usde_schools.py +++ b/karmaworld/apps/courses/management/commands/sanitize_usde_schools.py @@ -64,23 +64,17 @@ class Command(BaseCommand): self.stdout.write('There are no schools worth sanitizing.\n') return False - self.stdout.write(u"\n\nWARNING: Are you sure you want to delete these schools:\n") - for s in schools: - self.stdout.write('%s: %s' % (s.id, s.__unicode__())) - self.stdout.write('\n') - - if self.get_input("Do you want to delete these schools? [y/n] "): + self.stdout.write("...") + try: + schools.delete() + except: + self.stdout.write("that is too many to delete at once\n") + self.stdout.write("you are probabily using sqlite , doing them in batches\n") + for _i, a_school in enumerate(schools): + self.stdout.write("deleting %s of %s..." % (_i, self._schools_count)) + a_school.delete() + self.stdout.write("done\n") self.stdout.write("...") - try: - schools.delete() - except: - self.stdout.write("that is too many to delete at once\n") - self.stdout.write("you are probabily using sqlite , doing them in batches\n") - for _i, a_school in enumerate(schools): - self.stdout.write("deleting %s of %s..." % (_i, self._schools_count)) - a_school.delete() - self.stdout.write("done\n") - self.stdout.write("...") - self.stdout.write("all done!\n") - self.stdout.write("Deleted %s schools" % (self._schools_count)) + self.stdout.write("all done!\n") + self.stdout.write("Deleted %s schools" % (self._schools_count))