Просмотр исходного кода

Closes #9391: Remove 500-character limit for custom link text & URL fields

jeremystretch 3 лет назад
Родитель
Сommit
c5fb7b72f0

+ 1 - 0
docs/release-notes/version-3.3.md

@@ -93,6 +93,7 @@ Custom field UI visibility has no impact on API operation.
 * [#8995](https://github.com/netbox-community/netbox/issues/8995) - Enable arbitrary ordering of REST API results
 * [#9070](https://github.com/netbox-community/netbox/issues/9070) - Hide navigation menu items based on user permissions
 * [#9177](https://github.com/netbox-community/netbox/issues/9177) - Add tenant assignment for wireless LANs & links
+* [#9391](https://github.com/netbox-community/netbox/issues/9391) - Remove 500-character limit for custom link text & URL fields
 * [#9536](https://github.com/netbox-community/netbox/issues/9536) - Track API token usage times
 * [#9582](https://github.com/netbox-community/netbox/issues/9582) - Enable assigning config contexts based on device location
 

+ 21 - 0
netbox/extras/migrations/0077_customlink_extend_text_and_url.py

@@ -0,0 +1,21 @@
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('extras', '0076_tag_slug_unicode'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='customlink',
+            name='link_text',
+            field=models.TextField(),
+        ),
+        migrations.AlterField(
+            model_name='customlink',
+            name='link_url',
+            field=models.TextField(),
+        ),
+    ]

+ 2 - 4
netbox/extras/models/models.py

@@ -204,12 +204,10 @@ class CustomLink(ExportTemplatesMixin, WebhooksMixin, ChangeLoggedModel):
     enabled = models.BooleanField(
         default=True
     )
-    link_text = models.CharField(
-        max_length=500,
+    link_text = models.TextField(
         help_text="Jinja2 template code for link text"
     )
-    link_url = models.CharField(
-        max_length=500,
+    link_url = models.TextField(
         verbose_name='Link URL',
         help_text="Jinja2 template code for link URL"
     )