Stop using Django's SlugField to avoid conflicting validation

This commit is contained in:
Raphael Michel
2020-05-10 12:42:37 +02:00
parent 140f041cc1
commit c03c278ecd
3 changed files with 37 additions and 2 deletions

View File

@@ -0,0 +1,35 @@
# Generated by Django 3.0.6 on 2020-05-10 10:42
from django.db import migrations, models
import django_countries.fields
import pretix.helpers.countries
class Migration(migrations.Migration):
dependencies = [
('pretixbase', '0151_auto_20200421_0737'),
]
operations = [
migrations.AlterField(
model_name='event',
name='slug',
field=models.CharField(db_index=True, max_length=50),
),
migrations.AlterField(
model_name='invoiceaddress',
name='country',
field=django_countries.fields.CountryField(countries=pretix.helpers.countries.CachedCountries, max_length=2),
),
migrations.AlterField(
model_name='organizer',
name='slug',
field=models.CharField(db_index=True, max_length=50, unique=True),
),
migrations.AlterField(
model_name='seat',
name='seat_guid',
field=models.CharField(db_index=True, max_length=190),
),
]

View File

@@ -287,7 +287,7 @@ class Event(EventMixin, LoggedModel):
max_length=200,
verbose_name=_("Event name"),
)
slug = models.SlugField(
slug = models.CharField(
max_length=50, db_index=True,
help_text=_(
"Should be short, only contain lowercase letters, numbers, dots, and dashes, and must be unique among your "

View File

@@ -32,7 +32,7 @@ class Organizer(LoggedModel):
settings_namespace = 'organizer'
name = models.CharField(max_length=200,
verbose_name=_("Name"))
slug = models.SlugField(
slug = models.CharField(
max_length=50, db_index=True,
help_text=_(
"Should be short, only contain lowercase letters, numbers, dots, and dashes. Every slug can only be used "