-
Notifications
You must be signed in to change notification settings - Fork 319
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: discourage URLs in Person names (#7453)
* feat: disallow @ and : in name/ascii @ has long been disallowed via validation in the views and "/" has been disallowed for the name field via a validator. This adds @ and : to the validator and applies it to the name, plain, ascii, and ascii_short fields. This should apply everywhere we use a ModelForm. * test: update test * chore: migration
- Loading branch information
1 parent
c290525
commit d5009ee
Showing
3 changed files
with
96 additions
and
8 deletions.
There are no files selected for viewing
82 changes: 82 additions & 0 deletions
82
ietf/person/migrations/0002_alter_historicalperson_ascii_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
# Generated by Django 4.2.13 on 2024-05-22 18:50 | ||
|
||
from django.db import migrations, models | ||
import ietf.person.models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("person", "0001_initial"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="historicalperson", | ||
name="ascii", | ||
field=models.CharField( | ||
help_text="Name as rendered in ASCII (Latin, unaccented) characters.", | ||
max_length=255, | ||
validators=[ietf.person.models.name_character_validator], | ||
verbose_name="Full Name (ASCII)", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="historicalperson", | ||
name="ascii_short", | ||
field=models.CharField( | ||
blank=True, | ||
help_text="Example: A. Nonymous. Fill in this with initials and surname only if taking the initials and surname of the ASCII name above produces an incorrect initials-only form. (Blank is OK).", | ||
max_length=32, | ||
null=True, | ||
validators=[ietf.person.models.name_character_validator], | ||
verbose_name="Abbreviated Name (ASCII)", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="historicalperson", | ||
name="plain", | ||
field=models.CharField( | ||
blank=True, | ||
default="", | ||
help_text="Use this if you have a Spanish double surname. Don't use this for nicknames, and don't use it unless you've actually observed that the datatracker shows your name incorrectly.", | ||
max_length=64, | ||
validators=[ietf.person.models.name_character_validator], | ||
verbose_name="Plain Name correction (Unicode)", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="person", | ||
name="ascii", | ||
field=models.CharField( | ||
help_text="Name as rendered in ASCII (Latin, unaccented) characters.", | ||
max_length=255, | ||
validators=[ietf.person.models.name_character_validator], | ||
verbose_name="Full Name (ASCII)", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="person", | ||
name="ascii_short", | ||
field=models.CharField( | ||
blank=True, | ||
help_text="Example: A. Nonymous. Fill in this with initials and surname only if taking the initials and surname of the ASCII name above produces an incorrect initials-only form. (Blank is OK).", | ||
max_length=32, | ||
null=True, | ||
validators=[ietf.person.models.name_character_validator], | ||
verbose_name="Abbreviated Name (ASCII)", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="person", | ||
name="plain", | ||
field=models.CharField( | ||
blank=True, | ||
default="", | ||
help_text="Use this if you have a Spanish double surname. Don't use this for nicknames, and don't use it unless you've actually observed that the datatracker shows your name incorrectly.", | ||
max_length=64, | ||
validators=[ietf.person.models.name_character_validator], | ||
verbose_name="Plain Name correction (Unicode)", | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters