We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c31682e commit 846a836Copy full SHA for 846a836
apps/authorization/management/commands/change_all_access_type.py
@@ -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