Skip to content

Commit

Permalink
BB2-2894 Add script to change all apps to 13 month data access
Browse files Browse the repository at this point in the history
  • Loading branch information
Sharon Su committed Dec 27, 2023
1 parent c31682e commit 846a836
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions apps/authorization/management/commands/change_all_access_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from django.core.management.base import BaseCommand
from apps.dot_ext.models import Application

class Command(BaseCommand):
help = (
'Change all applications\' data access type to 13 month.'
)

def handle(self, *args, **options):
applications = Application.objects.all()
for app in applications:
if app.data_access_type != "THIRTEEN_MONTH":
app.data_access_type = "THIRTEEN_MONTH"
app.save() # logging in model will log the change

0 comments on commit 846a836

Please sign in to comment.