forked from CGM_Public/pretix_original
Allow 1-character event slugs as long as it's not a dot
This commit is contained in:
@@ -46,7 +46,7 @@ from django.core.exceptions import ValidationError
|
|||||||
from django.core.files.storage import default_storage
|
from django.core.files.storage import default_storage
|
||||||
from django.core.mail import get_connection
|
from django.core.mail import get_connection
|
||||||
from django.core.validators import (
|
from django.core.validators import (
|
||||||
MaxValueValidator, MinLengthValidator, MinValueValidator, RegexValidator,
|
MaxValueValidator, MinValueValidator, RegexValidator,
|
||||||
)
|
)
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.db.models import Exists, OuterRef, Prefetch, Q, Subquery, Value
|
from django.db.models import Exists, OuterRef, Prefetch, Q, Subquery, Value
|
||||||
@@ -412,11 +412,8 @@ class Event(EventMixin, LoggedModel):
|
|||||||
"remembered, but you can also choose to use a random value. "
|
"remembered, but you can also choose to use a random value. "
|
||||||
"This will be used in URLs, order codes, invoice numbers, and bank transfer references."),
|
"This will be used in URLs, order codes, invoice numbers, and bank transfer references."),
|
||||||
validators=[
|
validators=[
|
||||||
MinLengthValidator(
|
|
||||||
limit_value=2,
|
|
||||||
),
|
|
||||||
RegexValidator(
|
RegexValidator(
|
||||||
regex="^[a-zA-Z0-9][a-zA-Z0-9.-]*[a-zA-Z0-9]$",
|
regex="^[a-zA-Z0-9]([a-zA-Z0-9.-]*[a-zA-Z0-9])?$",
|
||||||
message=_("The slug may only contain letters, numbers, dots and dashes."),
|
message=_("The slug may only contain letters, numbers, dots and dashes."),
|
||||||
),
|
),
|
||||||
EventSlugBanlistValidator()
|
EventSlugBanlistValidator()
|
||||||
|
|||||||
Reference in New Issue
Block a user