Skip to content

Commit 846a836

Browse files
author
Sharon Su
committed
BB2-2894 Add script to change all apps to 13 month data access
1 parent c31682e commit 846a836

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from django.core.management.base import BaseCommand
2+
from apps.dot_ext.models import Application
3+
4+
class Command(BaseCommand):
5+
help = (
6+
'Change all applications\' data access type to 13 month.'
7+
)
8+
9+
def handle(self, *args, **options):
10+
applications = Application.objects.all()
11+
for app in applications:
12+
if app.data_access_type != "THIRTEEN_MONTH":
13+
app.data_access_type = "THIRTEEN_MONTH"
14+
app.save() # logging in model will log the change

0 commit comments

Comments
 (0)