]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Fix: make mail account password and refresh token text fields (#8107)
authorshamoon <4887959+shamoon@users.noreply.github.com>
Wed, 30 Oct 2024 04:54:47 +0000 (21:54 -0700)
committerGitHub <noreply@github.com>
Wed, 30 Oct 2024 04:54:47 +0000 (21:54 -0700)
src/documents/tests/test_migration_workflows.py
src/paperless_mail/migrations/0028_alter_mailaccount_password_and_more.py [new file with mode: 0644]
src/paperless_mail/models.py

index 9a911d2e5f16f8b7d33cd07e73097ce98df58ab9..69f5ed5fbe95cb9a65704913db67a2ef3fb6faeb 100644 (file)
@@ -8,7 +8,7 @@ class TestMigrateWorkflow(TestMigrations):
     dependencies = (
         (
             "paperless_mail",
-            "0027_mailaccount_expiration_mailaccount_account_type_and_more",
+            "0028_alter_mailaccount_password_and_more",
         ),
     )
 
diff --git a/src/paperless_mail/migrations/0028_alter_mailaccount_password_and_more.py b/src/paperless_mail/migrations/0028_alter_mailaccount_password_and_more.py
new file mode 100644 (file)
index 0000000..2a02796
--- /dev/null
@@ -0,0 +1,31 @@
+# Generated by Django 5.1.1 on 2024-10-30 04:31
+
+from django.db import migrations
+from django.db import models
+
+
+class Migration(migrations.Migration):
+    dependencies = [
+        (
+            "paperless_mail",
+            "0027_mailaccount_expiration_mailaccount_account_type_and_more",
+        ),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name="mailaccount",
+            name="password",
+            field=models.TextField(verbose_name="password"),
+        ),
+        migrations.AlterField(
+            model_name="mailaccount",
+            name="refresh_token",
+            field=models.TextField(
+                blank=True,
+                help_text="The refresh token to use for token authentication e.g. with oauth2.",
+                null=True,
+                verbose_name="refresh token",
+            ),
+        ),
+    ]
index 6ba00151dc4a205a91f78ac79c2ce151c60c3cd5..46b9db1ff44490bdb200c183b1fdaa2cdec94d94 100644 (file)
@@ -42,7 +42,7 @@ class MailAccount(document_models.ModelWithOwner):
 
     username = models.CharField(_("username"), max_length=256)
 
-    password = models.CharField(_("password"), max_length=3072)
+    password = models.TextField(_("password"))
 
     is_token = models.BooleanField(_("Is token authentication"), default=False)
 
@@ -62,9 +62,8 @@ class MailAccount(document_models.ModelWithOwner):
         default=MailAccountType.IMAP,
     )
 
-    refresh_token = models.CharField(
+    refresh_token = models.TextField(
         _("refresh token"),
-        max_length=3072,
         blank=True,
         null=True,
         help_text=_(