X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/1a949f7c97dc2f34c135f5cdf088df2927d3d652..84fbf26eed3101008c0c2056a5dc24c4620e36c0:/forum/management/commands/create_subscriptions.py diff --git a/forum/management/commands/create_subscriptions.py b/forum/management/commands/create_subscriptions.py index b97c970..3e0da3e 100644 --- a/forum/management/commands/create_subscriptions.py +++ b/forum/management/commands/create_subscriptions.py @@ -1,15 +1,15 @@ -from forum.models import User, SubscriptionSettings, QuestionSubscription -from django.core.management.base import NoArgsCommand - -class Command(NoArgsCommand): - def handle_noargs(self, **options): - users = User.objects.all() - for u in users: - s = SubscriptionSettings(user=u) - s.save() - - user_questions = u.questions.all() - - for q in user_questions: - sub = QuestionSubscription(user=u, question=q) +from forum.models import User, SubscriptionSettings, QuestionSubscription +from django.core.management.base import NoArgsCommand + +class Command(NoArgsCommand): + def handle_noargs(self, **options): + users = User.objects.all() + for u in users: + s = SubscriptionSettings(user=u) + s.save() + + user_questions = u.questions.all() + + for q in user_questions: + sub = QuestionSubscription(user=u, question=q) sub.save() \ No newline at end of file