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:
parent
c8f050531e
commit
7f7dfcd748
26
drakul/users/migrations/0004_auto_20191121_0109.py
Normal file
26
drakul/users/migrations/0004_auto_20191121_0109.py
Normal 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)]),
|
||||||
|
),
|
||||||
|
]
|
|
@ -1,7 +1,7 @@
|
||||||
from django.contrib.auth.models import AbstractUser
|
from django.contrib.auth.models import AbstractUser
|
||||||
from django.contrib.auth.models import UserManager as DjangoUserManager
|
from django.contrib.auth.models import UserManager as DjangoUserManager
|
||||||
from django.core.exceptions import ValidationError
|
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
|
from django.db import models, transaction
|
||||||
|
|
||||||
|
|
||||||
|
@ -88,8 +88,8 @@ class Character(models.Model):
|
||||||
)
|
)
|
||||||
|
|
||||||
name = models.CharField(
|
name = models.CharField(
|
||||||
max_length=12, # Blizzard limits character names to 2-12 ascii letters
|
max_length=12, # Blizzard limits character names to 2-12 characters
|
||||||
validators=[MinLengthValidator(2), RegexValidator("^[a-zA-Z]+$")],
|
validators=[MinLengthValidator(2)],
|
||||||
unique=True
|
unique=True
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue