forked from CGM_Public/pretix_original
Do not allow slugs to start with a non-alphanumeric character
This commit is contained in:
@@ -293,7 +293,7 @@ class Event(EventMixin, LoggedModel):
|
|||||||
"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=[
|
||||||
RegexValidator(
|
RegexValidator(
|
||||||
regex="^[a-zA-Z0-9.-]+$",
|
regex="^[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()
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class Organizer(LoggedModel):
|
|||||||
"once. This is being used in URLs to refer to your organizer accounts and your events."),
|
"once. This is being used in URLs to refer to your organizer accounts and your events."),
|
||||||
validators=[
|
validators=[
|
||||||
RegexValidator(
|
RegexValidator(
|
||||||
regex="^[a-zA-Z0-9.-]+$",
|
regex="^[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.")
|
||||||
),
|
),
|
||||||
OrganizerSlugBanlistValidator()
|
OrganizerSlugBanlistValidator()
|
||||||
|
|||||||
Reference in New Issue
Block a user