diff --git a/core/migrations/0036_auto_20211001_0248.py b/core/migrations/0036_auto_20211001_0248.py new file mode 100644 index 00000000..42d4f109 --- /dev/null +++ b/core/migrations/0036_auto_20211001_0248.py @@ -0,0 +1,24 @@ +# Generated by Django 2.2.24 on 2021-10-01 00:48 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0035_auto_20200216_1743'), + ] + + operations = [ + migrations.AddField( + model_name='user', + name='pronouns', + field=models.CharField(default='', max_length=64, verbose_name='pronouns'), + preserve_default=False, + ), + migrations.AlterField( + model_name='user', + name='sex', + field=models.CharField(blank=True, choices=[('MAN', 'Man'), ('WOMAN', 'Woman'), ('OTHER', 'Other')], max_length=10, null=True, verbose_name='sex'), + ), + ] diff --git a/core/models.py b/core/models.py index 7351c1ce..b9f0f243 100644 --- a/core/models.py +++ b/core/models.py @@ -227,8 +227,9 @@ class User(AbstractBaseUser): max_length=10, null=True, blank=True, - choices=[("MAN", _("Man")), ("WOMAN", _("Woman"))], + choices=[("MAN", _("Man")), ("WOMAN", _("Woman")), ("OTHER", _("Other"))], ) + pronouns = models.CharField(_("pronouns"), max_length=64, default='') tshirt_size = models.CharField( _("tshirt size"), max_length=5, diff --git a/core/views/forms.py b/core/views/forms.py index 1cfa42d9..712d3be6 100644 --- a/core/views/forms.py +++ b/core/views/forms.py @@ -222,6 +222,7 @@ class UserProfileForm(forms.ModelForm): "avatar_pict", "scrub_pict", "sex", + "pronouns", "second_email", "address", "parent_address", diff --git a/locale/fr/LC_MESSAGES/django.po b/locale/fr/LC_MESSAGES/django.po index 4f3a6080..2b00bab8 100644 --- a/locale/fr/LC_MESSAGES/django.po +++ b/locale/fr/LC_MESSAGES/django.po @@ -2061,7 +2061,7 @@ msgstr "blouse" #: core/models.py:203 msgid "sex" -msgstr "sexe" +msgstr "Genre" #: core/models.py:205 matmat/views.py:74 msgid "Man" @@ -2071,6 +2071,10 @@ msgstr "Homme" msgid "Woman" msgstr "Femme" +#:core/models.py:232 +msgid "Pronouns" +msgstr "Pronoms" + #: core/models.py:209 msgid "tshirt size" msgstr "taille de tshirt" diff --git a/rootplace/views.py b/rootplace/views.py index 570cae7b..460250cb 100644 --- a/rootplace/views.py +++ b/rootplace/views.py @@ -44,6 +44,7 @@ def merge_users(u1, u2): u1.date_of_birth = u1.date_of_birth or u2.date_of_birth u1.home = u1.home or u2.home u1.sex = u1.sex or u2.sex + u1.pronouns = u1.pronouns or u2.pronouns u1.tshirt_size = u1.tshirt_size or u2.tshirt_size u1.role = u1.role or u2.role u1.department = u1.department or u2.department