Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AIRAVATA-3319 Default username_initialized to true for existing user …
…profiles
- Loading branch information
1 parent
da7b121
commit 068ea53
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
django_airavata/apps/auth/migrations/0013_auto_20220118_1650.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Generated by Django 3.2.10 on 2022-01-18 16:50 | ||
|
||
from django.db import migrations | ||
|
||
|
||
def default_username_initialized(apps, schema_editor): | ||
UserProfile = apps.get_model("django_airavata_auth", "UserProfile") | ||
# Update all existing user's user_profiles to have username_initialized=True | ||
UserProfile.objects.all().update(username_initialized=True) | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('django_airavata_auth', '0012_merge_20211210_2041'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(default_username_initialized, migrations.RunPython.noop) | ||
] |