forked from mirrors/bookwyrm
Merge pull request #908 from mouse-reeve/case-insensitive-usernames
Makes localname case insensitive
This commit is contained in:
commit
33c97e38a9
2 changed files with 29 additions and 1 deletions
27
bookwyrm/migrations/0063_auto_20210408_1556.py
Normal file
27
bookwyrm/migrations/0063_auto_20210408_1556.py
Normal file
|
@ -0,0 +1,27 @@
|
|||
# Generated by Django 3.1.6 on 2021-04-08 15:56
|
||||
|
||||
import bookwyrm.models.fields
|
||||
import django.contrib.postgres.fields.citext
|
||||
import django.contrib.postgres.operations
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("bookwyrm", "0062_auto_20210407_1545"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
django.contrib.postgres.operations.CITextExtension(),
|
||||
migrations.AlterField(
|
||||
model_name="user",
|
||||
name="localname",
|
||||
field=django.contrib.postgres.fields.citext.CICharField(
|
||||
max_length=255,
|
||||
null=True,
|
||||
unique=True,
|
||||
validators=[bookwyrm.models.fields.validate_localname],
|
||||
),
|
||||
),
|
||||
]
|
|
@ -4,6 +4,7 @@ from urllib.parse import urlparse
|
|||
|
||||
from django.apps import apps
|
||||
from django.contrib.auth.models import AbstractUser, Group
|
||||
from django.contrib.postgres.fields import CICharField
|
||||
from django.core.validators import MinValueValidator
|
||||
from django.db import models
|
||||
from django.utils import timezone
|
||||
|
@ -54,7 +55,7 @@ class User(OrderedCollectionPageMixin, AbstractUser):
|
|||
summary = fields.HtmlField(null=True, blank=True)
|
||||
local = models.BooleanField(default=False)
|
||||
bookwyrm_user = fields.BooleanField(default=True)
|
||||
localname = models.CharField(
|
||||
localname = CICharField(
|
||||
max_length=255,
|
||||
null=True,
|
||||
unique=True,
|
||||
|
|
Loading…
Reference in a new issue