Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

increase character limits on all link fields to 2000 #9131

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/backend/InvenTree/InvenTree/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ class InvenTreeURLField(models.URLField):

def __init__(self, **kwargs):
"""Initialization method for InvenTreeURLField."""
# Max length for InvenTreeURLField is set to 200
kwargs['max_length'] = 200
# Max length for InvenTreeURLField is set to 2000
kwargs['max_length'] = 2000
super().__init__(**kwargs)


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Django 4.2.19 on 2025-02-21 12:30

import InvenTree.fields
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("build", "0054_build_start_date"),
]

operations = [
migrations.AlterField(
model_name='build',
name='link',
field=models.TextField() # Temporary change to force new ALTER COLUMN operation in the next migration
),
]
24 changes: 24 additions & 0 deletions src/backend/InvenTree/build/migrations/0056_alter_build_link.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Generated by Django 4.2.19 on 2025-02-21 13:46

import InvenTree.fields
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("build", "0055_auto_20250221_1230"),
]

operations = [
migrations.AlterField(
model_name="build",
name="link",
field=InvenTree.fields.InvenTreeURLField(
blank=True,
help_text="Link to external URL",
max_length=2000,
verbose_name="External Link",
),
),
]
5 changes: 4 additions & 1 deletion src/backend/InvenTree/build/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,10 @@ def status_text(self):
)

link = InvenTree.fields.InvenTreeURLField(
verbose_name=_('External Link'), blank=True, help_text=_('Link to external URL')
verbose_name=_('External Link'),
blank=True,
help_text=_('Link to external URL'),
max_length=2000,
)

priority = models.PositiveIntegerField(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.2.19 on 2025-02-21 15:13

import InvenTree.fields
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("common", "0034_alter_inventreecustomuserstatemodel_unique_together_and_more"),
]

operations = [migrations.AlterField(
model_name='attachment',
name='link',
field=models.TextField() # Temporary change to force new ALTER COLUMN operation in the next migration
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by Django 4.2.19 on 2025-02-21 15:15

import InvenTree.fields
from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
("common", "0035_auto_20250221_1513"),
]

operations = [
migrations.AlterField(
model_name="attachment",
name="link",
field=InvenTree.fields.InvenTreeURLField(
blank=True,
help_text="Link to external URL",
max_length=2000,
null=True,
verbose_name="Link",
),
),
]
1 change: 1 addition & 0 deletions src/backend/InvenTree/common/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1876,6 +1876,7 @@ def __str__(self):
null=True,
verbose_name=_('Link'),
help_text=_('Link to external URL'),
max_length=2000,
)

comment = models.CharField(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Generated by Django 4.2.19 on 2025-02-21 12:36

import InvenTree.fields
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("company", "0071_manufacturerpart_notes_supplierpart_notes"),
]

operations = [
migrations.AlterField(
model_name='company',
name='website',
field=models.TextField() # Temporary change to force new ALTER COLUMN operation in the next migration
),
migrations.AlterField(
model_name='company',
name='link',
field=models.TextField() # Temporary change to force new ALTER COLUMN operation in the next migration
),
migrations.AlterField(
model_name='address',
name='link',
field=models.TextField() # Temporary change to force new ALTER COLUMN operation in the next migration
),
migrations.AlterField(
model_name='supplierpart',
name='link',
field=models.TextField() # Temporary change to force new ALTER COLUMN operation in the next migration
),
migrations.AlterField(
model_name='manufacturerpart',
name='link',
field=models.TextField() # Temporary change to force new ALTER COLUMN operation in the next migration
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Generated by Django 4.2.19 on 2025-02-21 13:46

import InvenTree.fields
from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
("company", "0072_auto_20250221_1236"),
]

operations = [
migrations.AlterField(
model_name="address",
name="link",
field=InvenTree.fields.InvenTreeURLField(
blank=True,
help_text="Link to address information (external)",
max_length=2000,
verbose_name="Link",
),
),
migrations.AlterField(
model_name="company",
name="link",
field=InvenTree.fields.InvenTreeURLField(
blank=True,
help_text="Link to external company information",
max_length=2000,
verbose_name="Link",
),
),
migrations.AlterField(
model_name="company",
name="website",
field=InvenTree.fields.InvenTreeURLField(
blank=True,
help_text="Company website URL",
max_length=2000,
verbose_name="Website",
),
),
migrations.AlterField(
model_name="supplierpart",
name="link",
field=InvenTree.fields.InvenTreeURLField(
blank=True,
help_text="URL for external supplier part link",
max_length=2000,
null=True,
verbose_name="Link",
),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by Django 4.2.19 on 2025-02-21 14:51

import InvenTree.fields
from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
("company", "0073_alter_address_link_alter_company_link_and_more"),
]

operations = [
migrations.AlterField(
model_name="manufacturerpart",
name="link",
field=InvenTree.fields.InvenTreeURLField(
blank=True,
help_text="URL for external manufacturer part link",
max_length=2000,
null=True,
verbose_name="Link",
),
),
]
7 changes: 6 additions & 1 deletion src/backend/InvenTree/company/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ def get_api_url():
)

website = InvenTreeURLField(
blank=True, verbose_name=_('Website'), help_text=_('Company website URL')
blank=True,
verbose_name=_('Website'),
help_text=_('Company website URL'),
max_length=2000,
)

phone = models.CharField(
Expand Down Expand Up @@ -145,6 +148,7 @@ def get_api_url():
blank=True,
verbose_name=_('Link'),
help_text=_('Link to external company information'),
max_length=2000,
)

image = StdImageField(
Expand Down Expand Up @@ -440,6 +444,7 @@ def get_api_url():
blank=True,
verbose_name=_('Link'),
help_text=_('Link to address information (external)'),
max_length=2000,
)


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Generated by Django 4.2.19 on 2025-02-21 12:41

import InvenTree.fields
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("order", "0106_purchaseorder_start_date_returnorder_start_date_and_more"),
]

operations = [
migrations.AlterField(
model_name='purchaseorder',
name='link',
field=models.TextField() # Temporary change to force new ALTER COLUMN operation in the next migration
),
migrations.AlterField(
model_name='salesorder',
name='link',
field=models.TextField() # Temporary change to force new ALTER COLUMN operation in the next migration
),
migrations.AlterField(
model_name='returnorder',
name='link',
field=models.TextField() # Temporary change to force new ALTER COLUMN operation in the next migration
),
migrations.AlterField(
model_name='purchaseorderlineitem',
name='link',
field=models.TextField() # Temporary change to force new ALTER COLUMN operation in the next migration
),
migrations.AlterField(
model_name='salesorderlineitem',
name='link',
field=models.TextField() # Temporary change to force new ALTER COLUMN operation in the next migration
),
migrations.AlterField(
model_name='returnorderlineitem',
name='link',
field=models.TextField() # Temporary change to force new ALTER COLUMN operation in the next migration
),
migrations.AlterField(
model_name='purchaseorderextraline',
name='link',
field=models.TextField() # Temporary change to force new ALTER COLUMN operation in the next migration
),
migrations.AlterField(
model_name='salesorderextraline',
name='link',
field=models.TextField() # Temporary change to force new ALTER COLUMN operation in the next migration
),
migrations.AlterField(
model_name='returnorderextraline',
name='link',
field=models.TextField() # Temporary change to force new ALTER COLUMN operation in the next migration
),
migrations.AlterField(
model_name='salesordershipment',
name='link',
field=models.TextField() # Temporary change to force new ALTER COLUMN operation in the next migration
),
]
Loading
Loading