Remove character name regex validation; Blizzard allows a lot of weird characters and accents which we can never model completely.

This commit is contained in:
Casper V. Kristensen 2019-11-21 01:10:42 +01:00
parent c8f050531e
commit 7f7dfcd748
Signed by: caspervk
GPG key ID: 289CA03790535054
2 changed files with 29 additions and 3 deletions

View file

@ -0,0 +1,26 @@
# Generated by Django 2.2.6 on 2019-11-21 01:09
import django.core.validators
from django.db import migrations, models
import drakul.users.models
class Migration(migrations.Migration):
dependencies = [
('users', '0003_create_admin'),
]
operations = [
migrations.AlterModelManagers(
name='user',
managers=[
('objects', drakul.users.models.UserManager()),
],
),
migrations.AlterField(
model_name='character',
name='name',
field=models.CharField(max_length=12, unique=True, validators=[django.core.validators.MinLengthValidator(2)]),
),
]

View file

@ -1,7 +1,7 @@
from django.contrib.auth.models import AbstractUser
from django.contrib.auth.models import UserManager as DjangoUserManager
from django.core.exceptions import ValidationError
from django.core.validators import RegexValidator, MinLengthValidator
from django.core.validators import MinLengthValidator
from django.db import models, transaction
@ -88,8 +88,8 @@ class Character(models.Model):
)
name = models.CharField(
max_length=12, # Blizzard limits character names to 2-12 ascii letters
validators=[MinLengthValidator(2), RegexValidator("^[a-zA-Z]+$")],
max_length=12, # Blizzard limits character names to 2-12 characters
validators=[MinLengthValidator(2)],
unique=True
)