Skip to content

Commit

Permalink
use default=dict for JSONField model fields
Browse files Browse the repository at this point in the history
  • Loading branch information
austinjhunt committed Nov 26, 2022
1 parent f84d38c commit 57c2183
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Generated by Django 4.1.3 on 2022-11-26 20:18

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('web', '0009_administrationsettings_onedrive_email_notification_template_and_more'),
]

operations = [
migrations.AlterField(
model_name='administrationsettings',
name='google_oauth_json_credentials',
field=models.JSONField(blank=True, default=dict, null=True, verbose_name='Google OAuth Credentials - JSON (Copy and Paste)'),
),
migrations.AlterField(
model_name='administrationsettings',
name='google_service_account_auth_json_credentials',
field=models.JSONField(blank=True, default=dict, null=True, verbose_name='Google Service Account Credentials - JSON (Copy and Paste)'),
),
migrations.AlterField(
model_name='migration',
name='google_source',
field=models.JSONField(blank=True, default=dict, null=True, verbose_name='JSON object including at minimum id, name, or type as keys describing the source folder or shared drive being migrated. Type can be "shared_drive" or "folder"'),
),
migrations.AlterField(
model_name='migration',
name='source_data_scan_result',
field=models.JSONField(blank=True, default=dict, null=True, verbose_name='High-level stats about the migration to be run based on scanning the source data to be migrated'),
),
migrations.AlterField(
model_name='migration',
name='target',
field=models.JSONField(blank=True, default=dict, null=True, verbose_name='Information describing either a SharePoint Site Folder in a Document Library or a OneDrive Folder for the user OneDrive account'),
),
]
6 changes: 5 additions & 1 deletion GoogleSharePointMigrationAssistant/web/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,15 @@ class STATES(models.TextChoices):
end_timestamp = models.DateTimeField(blank=True, null=True)

google_source = models.JSONField(
default=dict,
null=True, blank=True, verbose_name=(
'JSON object including at minimum id, name, '
'or type as keys describing the source folder '
'or shared drive being migrated. Type can be '
'"shared_drive" or "folder"')
)
source_data_scan_result = models.JSONField(
default=dict,
null=True, blank=True,
verbose_name=(
'High-level stats about the migration '
Expand All @@ -67,7 +69,7 @@ class STATES(models.TextChoices):
default=False, verbose_name='Whether a post-completion notification has been sent')

target = models.JSONField(
blank=True, null=True, default={},
blank=True, null=True, default=dict,
verbose_name=(
'Information describing either a SharePoint '
'Site Folder in a Document Library or a OneDrive '
Expand Down Expand Up @@ -174,8 +176,10 @@ class Meta:

# For OAuth-driven migrations (user-driven)
google_oauth_json_credentials = models.JSONField(
default=dict,
null=True, blank=True, verbose_name='Google OAuth Credentials - JSON (Copy and Paste)')
google_service_account_auth_json_credentials = models.JSONField(
default=dict,
null=True, blank=True, verbose_name='Google Service Account Credentials - JSON (Copy and Paste)')

# SMTP-based email notifications.
Expand Down

0 comments on commit 57c2183

Please sign in to comment.