mirror of
https://github.com/fergalmoran/dss.api.git
synced 2025-12-22 09:18:13 +00:00
Fixed migrations
This commit is contained in:
15
spa/management/commands/create_notifications.py
Executable file
15
spa/management/commands/create_notifications.py
Executable file
@@ -0,0 +1,15 @@
|
||||
from django.core.management.base import NoArgsCommand
|
||||
from spa import models
|
||||
|
||||
|
||||
class Command(NoArgsCommand):
|
||||
def handle_noargs(self, **options):
|
||||
try:
|
||||
models.Notification.objects.all().delete()
|
||||
act = models.Activity.objects.all().order_by('-id').select_subclasses()
|
||||
for a in act:
|
||||
print "Creating for: {0}".format(a)
|
||||
a.create_notification(accept=True)
|
||||
|
||||
except Exception, ex:
|
||||
print "Debug exception: %s" % ex.message
|
||||
Reference in New Issue
Block a user