2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-02 03:30:54 +00:00

Remove client-side length validation in form inputs (#3911)

* Remove client-side length validation in form inputs

- Let the server throw an error (so the user sees it)

* Update instances of models.URLField to InvenTreeURLField
This commit is contained in:
Oliver
2022-11-10 12:51:15 +11:00
committed by GitHub
parent fb77158496
commit 57a20be5c3
8 changed files with 57 additions and 20 deletions

View File

@ -0,0 +1,29 @@
# Generated by Django 3.2.16 on 2022-11-10 01:08
import InvenTree.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('order', '0074_auto_20220709_0108'),
]
operations = [
migrations.AlterField(
model_name='purchaseorder',
name='link',
field=InvenTree.fields.InvenTreeURLField(blank=True, help_text='Link to external page', verbose_name='Link'),
),
migrations.AlterField(
model_name='salesorder',
name='link',
field=InvenTree.fields.InvenTreeURLField(blank=True, help_text='Link to external page', verbose_name='Link'),
),
migrations.AlterField(
model_name='salesordershipment',
name='link',
field=InvenTree.fields.InvenTreeURLField(blank=True, help_text='Link to external page', verbose_name='Link'),
),
]

View File

@ -30,7 +30,7 @@ from common.settings import currency_code_default
from company.models import Company, SupplierPart
from InvenTree.exceptions import log_error
from InvenTree.fields import (InvenTreeModelMoneyField, InvenTreeNotesField,
RoundingDecimalField)
InvenTreeURLField, RoundingDecimalField)
from InvenTree.helpers import decimal2string, getSetting, notify_responsible
from InvenTree.models import InvenTreeAttachment, ReferenceIndexingMixin
from InvenTree.status_codes import (PurchaseOrderStatus, SalesOrderStatus,
@ -81,7 +81,7 @@ class Order(MetadataMixin, ReferenceIndexingMixin):
description = models.CharField(max_length=250, verbose_name=_('Description'), help_text=_('Order description'))
link = models.URLField(blank=True, verbose_name=_('Link'), help_text=_('Link to external page'))
link = InvenTreeURLField(blank=True, verbose_name=_('Link'), help_text=_('Link to external page'))
creation_date = models.DateField(blank=True, null=True, verbose_name=_('Creation Date'))
@ -1254,7 +1254,7 @@ class SalesOrderShipment(models.Model):
help_text=_('Reference number for associated invoice'),
)
link = models.URLField(
link = InvenTreeURLField(
blank=True,
verbose_name=_('Link'),
help_text=_('Link to external page')