Add commands to hide all solutions for testing purposes
This commit is contained in:
parent
a2a93803a9
commit
9cf9fdcbec
|
|
@ -0,0 +1,12 @@
|
||||||
|
from django.core.management import BaseCommand
|
||||||
|
|
||||||
|
from books.models import Module
|
||||||
|
|
||||||
|
|
||||||
|
class Command(BaseCommand):
|
||||||
|
def handle(self, *args, **options):
|
||||||
|
self.stdout.write("Hiding solutions")
|
||||||
|
for module in Module.objects.all():
|
||||||
|
self.stdout.write("Hiding solutions in module {}.".format(module.title))
|
||||||
|
module.solutions_enabled_by.clear()
|
||||||
|
self.stdout.write("Hiding done")
|
||||||
Loading…
Reference in New Issue