Repository: paperless-ngx/paperless-ngx

Issue:
[BUG] Can´t save filtered view - filter possible too long
**Describe the bug**
The save view dialog is not closing, not showing an error, not saving the view.

**To Reproduce**
Steps to reproduce the behavior:
I am filtering documents for the last month (03-2022). adding some advanced search filters to exclude some document types, then I want to save this view. The save button goes immedeately back to normal, dialog is not closing, view was not saved, no error message.
The advanced filter is:
```
NOT type:Anleitung AND NOT type:Lieferschein AND NOT type:Vertrag AND NOT type:Aufforderung AND NOT type:BWA AND NOT type:Bescheinigung
```

**Expected behavior**
Filtered view of the advanced search should be saved. Even with long advanced filters.

**Screenshots**
Advanced search filter:
![image](https://user-images.githubusercontent.com/36714171/161327869-cf13d65c-389f-43db-ac01-6a91bc82e25d.png)
Save view dialog after klicking on save:
![image](https://user-images.githubusercontent.com/36714171/161328058-715154b0-df7f-4c7f-9e52-de195d05b1b0.png)


**Webserver logs**
the following log message comes up in the container:
`[2022-04-01 21:09:56,695] [WARNING] [django.request] Bad Request: /api/saved_views/`

**Browser network analyse**
Payload:
```
{"name":"filtered 03-2022","show_on_dashboard":false,"show_in_sidebar":false,"filter_rules":[{"rule_type":20,"value":"NOT type:Anleitung AND NOT type:Lieferschein AND NOT type:Vertrag AND NOT type:Aufforderung AND NOT type:BWA AND NOT type:Bescheinigung"},{"rule_type":8,"value":"2022-03-31"},{"rule_type":9,"value":"2022-03-01"}],"sort_reverse":false,"sort_field":"created"}
```
Response:
```
{"filter_rules":[{"value":["Stelle sicher, dass dieses Feld nicht mehr als 128 Zeichen lang ist."]},{},{}]}
```
> translated it says "please make sure that the field does not contain more than 128 characters".


**Relevant information**
 - chrome, opera
 - Version 1.6.0
 - Installation method: docker-compose with postgres & tika & gotenberg
- 


Discussion:
Our current database model limits the size of a saved filter to 128 chars.  It should be possible to increase that to 255, but we can't go beyond that due to database limitations.

Resolving patch:
diff --git a/src/documents/migrations/1018_alter_savedviewfilterrule_value.py b/src/documents/migrations/1018_alter_savedviewfilterrule_value.py
new file mode 100644
--- /dev/null
+++ b/src/documents/migrations/1018_alter_savedviewfilterrule_value.py
@@ -0,0 +1,20 @@
+# Generated by Django 4.0.3 on 2022-04-01 22:50
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ("documents", "1017_alter_savedviewfilterrule_rule_type"),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name="savedviewfilterrule",
+            name="value",
+            field=models.CharField(
+                blank=True, max_length=255, null=True, verbose_name="value"
+            ),
+        ),
+    ]
diff --git a/src/documents/models.py b/src/documents/models.py
--- a/src/documents/models.py
+++ b/src/documents/models.py
@@ -375,7 +375,7 @@ class SavedViewFilterRule(models.Model):
 
     rule_type = models.PositiveIntegerField(_("rule type"), choices=RULE_TYPES)
 
-    value = models.CharField(_("value"), max_length=128, blank=True, null=True)
+    value = models.CharField(_("value"), max_length=255, blank=True, null=True)
 
     class Meta:
         verbose_name = _("filter rule")


Test patch: