You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2022/01/18 17:05:42 UTC

[airavata-django-portal] 01/02: AIRAVATA-3319 Default username_initialized to true for existing user profiles

This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git

commit 068ea53b17c8781f249e945670b14e7eb80c4d00
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Tue Jan 18 12:03:01 2022 -0500

    AIRAVATA-3319 Default username_initialized to true for existing user profiles
---
 .../apps/auth/migrations/0013_auto_20220118_1650.py  | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/django_airavata/apps/auth/migrations/0013_auto_20220118_1650.py b/django_airavata/apps/auth/migrations/0013_auto_20220118_1650.py
new file mode 100644
index 0000000..fe52ef2
--- /dev/null
+++ b/django_airavata/apps/auth/migrations/0013_auto_20220118_1650.py
@@ -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)
+    ]