From b4db5e50c890663a3b85cf037f1d82af28f7dd9e Mon Sep 17 00:00:00 2001 From: Aman Agrawal Date: Sat, 9 Nov 2024 10:26:27 +0530 Subject: [PATCH] preregistration: Add field to track import progress. We add a field to track user's progress and other details during the import process. --- ...eregistrationrealm_data_import_metadata.py | 20 +++++++++++++++++++ zerver/models/prereg_users.py | 3 +++ 2 files changed, 23 insertions(+) create mode 100644 zerver/migrations/0629_preregistrationrealm_data_import_metadata.py diff --git a/zerver/migrations/0629_preregistrationrealm_data_import_metadata.py b/zerver/migrations/0629_preregistrationrealm_data_import_metadata.py new file mode 100644 index 0000000000..ed703497e6 --- /dev/null +++ b/zerver/migrations/0629_preregistrationrealm_data_import_metadata.py @@ -0,0 +1,20 @@ +# Generated by Django 5.0.9 on 2024-11-21 02:32 + +import django.core.serializers.json +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("zerver", "0628_remove_realm_invite_to_realm_policy"), + ] + + operations = [ + migrations.AddField( + model_name="preregistrationrealm", + name="data_import_metadata", + field=models.JSONField( + default=dict, encoder=django.core.serializers.json.DjangoJSONEncoder + ), + ), + ] diff --git a/zerver/models/prereg_users.py b/zerver/models/prereg_users.py index 4f94eba70b..741d487488 100644 --- a/zerver/models/prereg_users.py +++ b/zerver/models/prereg_users.py @@ -1,4 +1,5 @@ from django.contrib.contenttypes.fields import GenericRelation +from django.core.serializers.json import DjangoJSONEncoder from django.db import models from django.db.models import CASCADE, Q, QuerySet from django.db.models.functions import Upper @@ -49,6 +50,8 @@ class PreregistrationRealm(models.Model): UserProfile, null=True, related_name="+", on_delete=models.SET_NULL ) + data_import_metadata = models.JSONField(default=dict, encoder=DjangoJSONEncoder) + class PreregistrationUser(models.Model): # Data on a partially created user, before the completion of