summaryrefslogtreecommitdiffstats
path: root/forum/management/commands/message_to_everyone.py
diff options
context:
space:
mode:
Diffstat (limited to 'forum/management/commands/message_to_everyone.py')
-rw-r--r--forum/management/commands/message_to_everyone.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/forum/management/commands/message_to_everyone.py b/forum/management/commands/message_to_everyone.py
new file mode 100644
index 00000000..c020c178
--- /dev/null
+++ b/forum/management/commands/message_to_everyone.py
@@ -0,0 +1,12 @@
+from django.core.management.base import NoArgsCommand
+from django.contrib.auth.models import User
+import sys
+
+class Command(NoArgsCommand):
+ def handle_noargs(self, **options):
+ msg = None
+ if msg == None:
+ print 'to run this command, please first edit the file %s' % __file__
+ sys.exit(1)
+ for u in User.objects.all():
+ u.message_set.create(message = msg % u.username)