From 9775762926d2ca7aabc031672686ee850ec12e85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carles=20Barrobe=CC=81s?= Date: Tue, 1 Jun 2021 17:37:11 +0200 Subject: [PATCH] GDPR, i18n and translations --- .dockerignore | 1 + Makefile | 2 +- docker-compose.yml | 4 +- humans/legacy/export.py | 2 +- locale/ca/LC_MESSAGES/django.po | 261 +++++++++++++----- shipanaro/admin.py | 2 +- shipanaro/gdpr/__init__.py | 1 + shipanaro/gdpr/admin.py | 9 + shipanaro/gdpr/apps.py | 6 + shipanaro/gdpr/migrations/0001_initial.py | 27 ++ shipanaro/gdpr/migrations/__init__.py | 0 shipanaro/gdpr/models.py | 20 +- .../migrations/0013_auto_20210601_1535.py | 83 ++++++ shipanaro/models.py | 72 +++-- shipanaro/settings_django.py | 3 +- 15 files changed, 401 insertions(+), 92 deletions(-) create mode 100644 shipanaro/gdpr/admin.py create mode 100644 shipanaro/gdpr/apps.py create mode 100644 shipanaro/gdpr/migrations/0001_initial.py create mode 100644 shipanaro/gdpr/migrations/__init__.py create mode 100644 shipanaro/migrations/0013_auto_20210601_1535.py diff --git a/.dockerignore b/.dockerignore index 2ccbe46..0d7c76e 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1 +1,2 @@ /node_modules/ +/.venv/ diff --git a/Makefile b/Makefile index bb31616..6a19fed 100644 --- a/Makefile +++ b/Makefile @@ -40,7 +40,7 @@ i18n: @echo "Please edit locale/ca/LC_MESSAGES/django.po to add new translations" i18n-compile: - ./indocker.sh ./manage.py compilemessages + ./indocker.sh ./manage.py compilemessages --ignore .venv docker-compose restart web package: diff --git a/docker-compose.yml b/docker-compose.yml index ee07492..23f5705 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -26,8 +26,8 @@ services: image: postgres:11 environment: - "POSTGRES_HOST_AUTH_METHOD=trust" - #ports: - #- 5432:5432 + ports: + - 5432:5432 volumes: - postgres_data:/var/lib/postgresql/data/ ldap: diff --git a/humans/legacy/export.py b/humans/legacy/export.py index d9ff9f4..78dcaf9 100644 --- a/humans/legacy/export.py +++ b/humans/legacy/export.py @@ -1,5 +1,5 @@ #!/usr/bin/python -# -*- coding: utf8 -*- +# -*- coding: utf-8 -*- from datetime import datetime, date from functools import partial import traceback diff --git a/locale/ca/LC_MESSAGES/django.po b/locale/ca/LC_MESSAGES/django.po index d415a68..f59686d 100644 --- a/locale/ca/LC_MESSAGES/django.po +++ b/locale/ca/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-01-26 18:10+0000\n" +"POT-Creation-Date: 2021-06-01 15:13+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -27,196 +27,309 @@ msgstr "Contacte" msgid "Web" msgstr "" -#: humans/templates/shipanaro/index.html:8 +#: humans/templates/shipanaro/index.html:7 msgid "Pàgina oficial del partit. Inclou el bloc i l'ideari del partit." msgstr "" -#: humans/templates/shipanaro/index.html:11 -#: humans/templates/shipanaro/index.html:75 -#: humans/templates/shipanaro/index.html:88 -#: humans/templates/shipanaro/index.html:99 -#: humans/templates/shipanaro/index.html:112 -#: humans/templates/shipanaro/index.html:123 +#: humans/templates/shipanaro/index.html:8 +#: humans/templates/shipanaro/index.html:43 +#: humans/templates/shipanaro/index.html:55 +#: humans/templates/shipanaro/index.html:65 +#: humans/templates/shipanaro/index.html:76 +#: humans/templates/shipanaro/index.html:85 msgid "Go" msgstr "Anar-hi" -#: humans/templates/shipanaro/index.html:14 +#: humans/templates/shipanaro/index.html:9 msgid "Bloc" msgstr "" -#: humans/templates/shipanaro/index.html:17 +#: humans/templates/shipanaro/index.html:10 msgid "Ideari" msgstr "" -#: humans/templates/shipanaro/index.html:25 +#: humans/templates/shipanaro/index.html:17 msgid "Xarxes socials" msgstr "" -#: humans/templates/shipanaro/index.html:27 +#: humans/templates/shipanaro/index.html:18 msgid "Troba'ns a les xarxes i comparteix el que hi publiquem." msgstr "" -#: humans/templates/shipanaro/index.html:32 +#: humans/templates/shipanaro/index.html:19 msgid "Mastodon" msgstr "" -#: humans/templates/shipanaro/index.html:38 +#: humans/templates/shipanaro/index.html:20 msgid "Twitter" msgstr "" -#: humans/templates/shipanaro/index.html:44 +#: humans/templates/shipanaro/index.html:21 msgid "Facebook" msgstr "" -#: humans/templates/shipanaro/index.html:47 +#: humans/templates/shipanaro/index.html:22 msgid "Instagram" msgstr "" -#: humans/templates/shipanaro/index.html:58 +#: humans/templates/shipanaro/index.html:31 msgid "Sistema de Participació" msgstr "" -#: humans/templates/shipanaro/index.html:59 +#: humans/templates/shipanaro/index.html:32 msgid "Sistema de votació del partit." msgstr "" -#: humans/templates/shipanaro/index.html:61 +#: humans/templates/shipanaro/index.html:33 msgid "New" msgstr "Nou" -#: humans/templates/shipanaro/index.html:64 +#: humans/templates/shipanaro/index.html:34 msgid "Old" msgstr "Antic" -#: humans/templates/shipanaro/index.html:72 +#: humans/templates/shipanaro/index.html:41 msgid "Pads" -msgstr "" +msgstr "Pads" -#: humans/templates/shipanaro/index.html:73 +#: humans/templates/shipanaro/index.html:42 msgid "Eina col·laborativa d'edició de textos" msgstr "" -#: humans/templates/shipanaro/index.html:85 +#: humans/templates/shipanaro/index.html:52 msgid "Llistes de correu" msgstr "" -#: humans/templates/shipanaro/index.html:86 +#: humans/templates/shipanaro/index.html:53 msgid "Eina de comunicació de grups per correu electrònic." msgstr "" -#: humans/templates/shipanaro/index.html:96 +#: humans/templates/shipanaro/index.html:63 msgid "Xat" msgstr "" -#: humans/templates/shipanaro/index.html:97 +#: humans/templates/shipanaro/index.html:64 msgid "Eina de missatgeria instantània per a grups." msgstr "" -#: humans/templates/shipanaro/index.html:109 +#: humans/templates/shipanaro/index.html:74 msgid "Wiki" msgstr "" -#: humans/templates/shipanaro/index.html:110 +#: humans/templates/shipanaro/index.html:75 msgid "Wiki del partit." msgstr "" -#: humans/templates/shipanaro/index.html:120 +#: humans/templates/shipanaro/index.html:83 msgid "Cloud" msgstr "" -#: humans/templates/shipanaro/index.html:121 +#: humans/templates/shipanaro/index.html:84 msgid "Repositori de fitxers i documents." msgstr "" -#: shipanaro/admin.py:98 +#: shipanaro/admin.py:107 #, fuzzy #| msgid "Contacte" msgid "Contact" msgstr "Contacte" -#: shipanaro/admin.py:107 +#: shipanaro/admin.py:116 shipanaro/models.py:63 msgid "Address" -msgstr "" +msgstr "Adreça" -#: shipanaro/admin.py:120 +#: shipanaro/admin.py:129 msgid "Status" -msgstr "" +msgstr "Estat" -#: shipanaro/admin.py:129 +#: shipanaro/admin.py:138 shipanaro/models.py:88 msgid "Notes" -msgstr "" +msgstr "Notes" -#: shipanaro/admin.py:134 +#: shipanaro/admin.py:141 msgid "Legacy" msgstr "" -#: shipanaro/auth/views.py:33 shipanaro/templates/registration/login.html:9 +#: shipanaro/auth/forms.py:61 +msgid "Your old password was entered incorrectly. Please enter it again." +msgstr "La teva contrasenya antiga no és correcta. Torna-la a introduir." + +#: shipanaro/auth/forms.py:65 +msgid "Old password" +msgstr "Contrasenya antiga" + +#: shipanaro/auth/views.py:39 shipanaro/templates/registration/login.html:8 #: shipanaro/templates/registration/password_reset_complete.html:5 -#: shipanaro/templates/shipanaro/base.html:33 +#: shipanaro/templates/shipanaro/base.html:43 msgid "Log in" -msgstr "" +msgstr "Entrar" -#: shipanaro/auth/views.py:109 +#: shipanaro/auth/views.py:108 +msgid "Password change" +msgstr "Canvi de contrasenya" + +#: shipanaro/auth/views.py:140 msgid "Personal info" -msgstr "" +msgstr "Info Personal" + +#: shipanaro/gdpr/models.py:10 +msgid "Accept" +msgstr "Acceptar" + +#: shipanaro/gdpr/models.py:11 +msgid "Reject" +msgstr "Rebutjar" #: shipanaro/models.py:9 shipanaro/models.py:18 msgid "Male" -msgstr "" +msgstr "Home" #: shipanaro/models.py:10 shipanaro/models.py:19 msgid "Female" -msgstr "" +msgstr "Dona" #: shipanaro/models.py:11 msgid "Not Applicable" -msgstr "" +msgstr "No aplicable" #: shipanaro/models.py:20 -msgid "Gender non-conforming" -msgstr "" +msgid "Agender" +msgstr "Agènere" + +#: shipanaro/models.py:21 +msgid "Fluid" +msgstr "Gènere fluid" + +#: shipanaro/models.py:22 +msgid "Non-binary" +msgstr "Gènere no binari" + +#: shipanaro/models.py:23 +msgid "Pangender" +msgstr "Pangènere" #: shipanaro/models.py:24 +msgid "Transgender" +msgstr "Transgènere" + +#: shipanaro/models.py:25 +msgid "Gender non-conforming" +msgstr "Gènere no conforme" + +#: shipanaro/models.py:29 msgid "Passport" -msgstr "" +msgstr "Passaport" + +#: shipanaro/models.py:30 +msgid "Documento Nacional de Identidad" +msgstr "DNI" -#: shipanaro/models.py:27 +#: shipanaro/models.py:31 +msgid "Número de Identificación de Extranjeros" +msgstr "NIE" + +#: shipanaro/models.py:32 msgid "Unknown" -msgstr "" +msgstr "Desconegut" + +#: shipanaro/models.py:40 +msgid "Assigned sex" +msgstr "Sexe assignat" + +#: shipanaro/models.py:44 +msgid "Gender" +msgstr "Gènere" -#: shipanaro/models.py:66 +#: shipanaro/models.py:48 +msgid "Custom Gender" +msgstr "Gènere a mida" + +#: shipanaro/models.py:54 +msgid "Birthday" +msgstr "Aniversari" + +#: shipanaro/models.py:57 +msgid "Nationality" +msgstr "Nacionalitat" + +#: shipanaro/models.py:67 +msgid "City" +msgstr "Ciutat" + +#: shipanaro/models.py:71 +msgid "Postcode" +msgstr "Codi Postal" + +#: shipanaro/models.py:75 +msgid "Province" +msgstr "Província" + +#: shipanaro/models.py:79 +msgid "Phone" +msgstr "Telèfon" + +#: shipanaro/models.py:83 +msgid "Phone 2" +msgstr "Telèfon 2" + +#: shipanaro/models.py:113 msgid "Newsletter" -msgstr "" +msgstr "Butlletí" -#: shipanaro/templates/registration/login.html:12 +#: shipanaro/templates/registration/login.html:11 msgid "Password reset" +msgstr "Reiniciar contrasenya" + +#: shipanaro/templates/registration/password_change_done.html:4 +msgid "Your password was changed." +msgstr "La teva contrasenya s'ha modificat." + +#: shipanaro/templates/registration/password_change_form.html:4 +msgid "" +"Please enter your old password, for security’s sake, and then enter your new " +"password twice so we can verify you typed it in correctly." msgstr "" +"Sisplau introdueix la contrasenya antiga, per seguretat, i llavors " +"introdueix la nova contrasenya dos cops per a poder comprovar que l'has " +"entrada correctament." + +#: shipanaro/templates/registration/password_change_form.html:9 +msgid "Change password" +msgstr "Canviar contrasenya" #: shipanaro/templates/registration/password_reset_complete.html:4 msgid "Your password has been set. You may go ahead and log in now." msgstr "" +"Hem reiniciat la teva contrasenya. Ja pots tirar milles i entrar al sistema." #: shipanaro/templates/registration/password_reset_confirm.html:5 msgid "" "Please enter your new password twice so we can verify you typed it in " "correctly." msgstr "" +"Sisplau introdueix la nova contrasenya dos cops per a poder comprovar que " +"l'has entrada correctament." #: shipanaro/templates/registration/password_reset_confirm.html:10 msgid "Change my password" -msgstr "" +msgstr "Canviar la meva contrasenya" #: shipanaro/templates/registration/password_reset_confirm.html:14 msgid "" "The password reset link was invalid, possibly because it has already been " "used. Please request a new password reset." msgstr "" +"L'enllaç per reiniciar la contrasenya no és vàlid, potser ja s'ha fet " +"servir. Sisplau demana un nou reinici de contrasenya." #: shipanaro/templates/registration/password_reset_done.html:4 msgid "" "We've emailed you instructions for setting your password, if an account " "exists with the email you entered. You should receive them shortly." msgstr "" +"Si hi havia un compte amb el correu que ens has indicat, hi hem enviat un " +"correu amb instruccions per configurar la contrasenya. Les hauries de rebre " +"en breu." #: shipanaro/templates/registration/password_reset_done.html:5 msgid "" @@ -230,50 +343,62 @@ msgid "" "You're receiving this email because you requested a password reset for your " "user account at %(site_name)s." msgstr "" +"Rebs aquest correu perquè has demanat reiniciar la contrasenya al teu compte " +"a %(site_name)s." #: shipanaro/templates/registration/password_reset_email.html:4 msgid "Please go to the following page and choose a new password:" -msgstr "" +msgstr "Sisplau ves a la pàgina següent i tria una nova contrasenya:" #: shipanaro/templates/registration/password_reset_email.html:8 msgid "Your username, in case you've forgotten:" -msgstr "" +msgstr "El teu nom d'usuari, en cas que l'hagis oblidat" #: shipanaro/templates/registration/password_reset_email.html:10 msgid "Thanks for using our site!" -msgstr "" +msgstr "Gràcies per fer servir el nostre web!" #: shipanaro/templates/registration/password_reset_email.html:12 #, python-format msgid "The %(site_name)s team" -msgstr "" +msgstr "L'equip de %(site_name)s" #: shipanaro/templates/registration/password_reset_form.html:4 msgid "" "Forgotten your password? Enter your email address below, and we'll email " "instructions for setting a new one." msgstr "" +"Has oblidat la contrasenya? Entra el teu correu a sota i t'enviarem " +"instruccions per posar-ne una de nova." #: shipanaro/templates/registration/password_reset_form.html:9 msgid "Reset my password" -msgstr "" +msgstr "Reiniciar contrasenya" #: shipanaro/templates/registration/profile.html:13 msgid "Submit" -msgstr "" +msgstr "Enviar" #: shipanaro/templates/registration/profile.html:18 msgid "Cancel membership" -msgstr "" +msgstr "Cancel.lar afiliació" -#: shipanaro/templates/shipanaro/base.html:26 +#: shipanaro/templates/shipanaro/base.html:27 msgid "Administration" -msgstr "" +msgstr "Administració" -#: shipanaro/templates/shipanaro/base.html:29 +#: shipanaro/templates/shipanaro/base.html:32 +msgid "My Account" +msgstr "El meu compte" + +#: shipanaro/templates/shipanaro/base.html:36 +msgid "Change Password" +msgstr "Canviar contrasenya" + +#: shipanaro/templates/shipanaro/base.html:39 msgid "Log out" -msgstr "" +msgstr "Sortir" #: shipanaro/views.py:14 msgid "Home" -msgstr "" +msgstr "Casa" diff --git a/shipanaro/admin.py b/shipanaro/admin.py index 76b8d07..2f4034a 100644 --- a/shipanaro/admin.py +++ b/shipanaro/admin.py @@ -2,7 +2,7 @@ from django.contrib import admin from django.contrib.admin import ModelAdmin from django.contrib.auth.admin import GroupAdmin, UserAdmin -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from django_admin_listfilter_dropdown.filters import DropdownFilter from rangefilter.filter import DateRangeFilter from shipanaro.auth.models import User, Group diff --git a/shipanaro/gdpr/__init__.py b/shipanaro/gdpr/__init__.py index e69de29..a159507 100644 --- a/shipanaro/gdpr/__init__.py +++ b/shipanaro/gdpr/__init__.py @@ -0,0 +1 @@ +default_app_config = "shipanaro.gdpr.apps.GdprConfig" diff --git a/shipanaro/gdpr/admin.py b/shipanaro/gdpr/admin.py new file mode 100644 index 0000000..e38b247 --- /dev/null +++ b/shipanaro/gdpr/admin.py @@ -0,0 +1,9 @@ +from django.contrib import admin +from django.contrib.admin import ModelAdmin +from . import models + + +@admin.register(models.Consent) +class ConsentAdmin(ModelAdmin): + list_display = ("user", "purpose", "accepted") + search_fields = ("user", "purpose") diff --git a/shipanaro/gdpr/apps.py b/shipanaro/gdpr/apps.py new file mode 100644 index 0000000..f6fff97 --- /dev/null +++ b/shipanaro/gdpr/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class GdprConfig(AppConfig): + name = "shipanaro.gdpr" + verbose_name = "GDPR consentiments informats" diff --git a/shipanaro/gdpr/migrations/0001_initial.py b/shipanaro/gdpr/migrations/0001_initial.py new file mode 100644 index 0000000..6cd7786 --- /dev/null +++ b/shipanaro/gdpr/migrations/0001_initial.py @@ -0,0 +1,27 @@ +# Generated by Django 3.1.8 on 2021-06-01 15:27 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.CreateModel( + name='Consent', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('purpose', models.CharField(max_length=64)), + ('creation_time', models.DateTimeField(auto_now_add=True)), + ('accepted', models.CharField(choices=[('Y', 'Acceptar'), ('N', 'Rebutjar')], max_length=1, null=True)), + ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ], + ), + ] diff --git a/shipanaro/gdpr/migrations/__init__.py b/shipanaro/gdpr/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/shipanaro/gdpr/models.py b/shipanaro/gdpr/models.py index 1e68f20..f5f7866 100644 --- a/shipanaro/gdpr/models.py +++ b/shipanaro/gdpr/models.py @@ -1,11 +1,29 @@ # -*- coding: utf-8 -*- from django.db import models from django.contrib.auth import get_user_model +from django.utils.translation import gettext as _ User = get_user_model() +ACCEPT_CHOICES = ( + ("Y", _("Accept")), + ("N", _("Reject")), +) + + class Consent(models.Model): - user = models.ForeignKey(User) + """ + Record the explicit consent of a User to a purpose + """ + + user = models.ForeignKey(User, on_delete=models.CASCADE) purpose = models.CharField(max_length=64) creation_time = models.DateTimeField(auto_now_add=True) + # accepted is null if user has not yet consented to a purpose, but should + accepted = models.CharField( + max_length=1, + null=True, + blank=False, + choices=ACCEPT_CHOICES, + ) diff --git a/shipanaro/migrations/0013_auto_20210601_1535.py b/shipanaro/migrations/0013_auto_20210601_1535.py new file mode 100644 index 0000000..43622b6 --- /dev/null +++ b/shipanaro/migrations/0013_auto_20210601_1535.py @@ -0,0 +1,83 @@ +# Generated by Django 3.1.8 on 2021-06-01 15:35 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('shipanaro', '0012_add_membership_fields_20210518_1142'), + ] + + operations = [ + migrations.AlterField( + model_name='membership', + name='address', + field=models.CharField(max_length=140, verbose_name='Adreça'), + ), + migrations.AlterField( + model_name='membership', + name='assigned_sex', + field=models.IntegerField(choices=[(1, 'Home'), (2, 'Dona'), (9, 'No aplicable')], verbose_name='Sexe assignat'), + ), + migrations.AlterField( + model_name='membership', + name='birthday', + field=models.DateField(verbose_name='Aniversari'), + ), + migrations.AlterField( + model_name='membership', + name='city', + field=models.CharField(max_length=70, verbose_name='Ciutat'), + ), + migrations.AlterField( + model_name='membership', + name='gender', + field=models.IntegerField(choices=[(1, 'Home'), (2, 'Dona'), (3, 'Agènere'), (4, 'Gènere fluid'), (5, 'Gènere no binari'), (6, 'Pangènere'), (7, 'Transgènere'), (9, 'Gènere no conforme')], verbose_name='Gènere'), + ), + migrations.AlterField( + model_name='membership', + name='gender_custom', + field=models.CharField(blank=True, max_length=40, null=True, verbose_name='Gènere a mida'), + ), + migrations.AlterField( + model_name='membership', + name='nationality', + field=models.CharField(max_length=20, verbose_name='Nacionalitat'), + ), + migrations.AlterField( + model_name='membership', + name='nid_type', + field=models.IntegerField(choices=[(7240, 'Passaport'), (7241, 'DNI'), (7242, 'NIE'), (0, 'Desconegut')]), + ), + migrations.AlterField( + model_name='membership', + name='notes', + field=models.TextField(blank=True, verbose_name='Notes'), + ), + migrations.AlterField( + model_name='membership', + name='phone', + field=models.CharField(max_length=20, verbose_name='Telèfon'), + ), + migrations.AlterField( + model_name='membership', + name='phone_2', + field=models.CharField(blank=True, max_length=20, verbose_name='Telèfon 2'), + ), + migrations.AlterField( + model_name='membership', + name='postal_code', + field=models.CharField(max_length=20, verbose_name='Codi Postal'), + ), + migrations.AlterField( + model_name='membership', + name='province', + field=models.CharField(max_length=70, verbose_name='Província'), + ), + migrations.AlterField( + model_name='subscription', + name='service', + field=models.CharField(choices=[('newsletter', 'Butlletí')], max_length=20), + ), + ] diff --git a/shipanaro/models.py b/shipanaro/models.py index d16a9e7..80603a6 100644 --- a/shipanaro/models.py +++ b/shipanaro/models.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- from django.db import models -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from shipanaro.auth.models import User, Group # Based on ISO 5218 @@ -27,8 +27,8 @@ NIDS = ( (7240, _("Passport")), - (7241, "Documento Nacional de Identidad"), - (7242, "Número de Identificación de Extranjeros"), + (7241, _("Documento Nacional de Identidad")), + (7242, _("Número de Identificación de Extranjeros")), (0, _("Unknown")), ) @@ -36,21 +36,61 @@ class Membership(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) uid = models.IntegerField() - assigned_sex = models.IntegerField(choices=SEXES) - gender = models.IntegerField(choices=GENDERS) - gender_custom = models.CharField(max_length=40, blank=True, null=True) - birthday = models.DateField() - nationality = models.CharField(max_length=20) + assigned_sex = models.IntegerField( + verbose_name=_("Assigned sex"), + choices=SEXES, + ) + gender = models.IntegerField( + verbose_name=_("Gender"), + choices=GENDERS, + ) + gender_custom = models.CharField( + verbose_name=_("Custom Gender"), + max_length=40, + blank=True, + null=True, + ) + birthday = models.DateField( + verbose_name=_("Birthday"), + ) + nationality = models.CharField( + verbose_name=_("Nationality"), + max_length=20, + ) nid = models.CharField(max_length=50) nid_type = models.IntegerField(choices=NIDS) - address = models.CharField(max_length=140) - city = models.CharField(max_length=70) - postal_code = models.CharField(max_length=20) - province = models.CharField(max_length=70) - phone = models.CharField(max_length=20) - phone_2 = models.CharField(max_length=20, blank=True) - notes = models.TextField(blank=True) - contact_id = models.CharField(max_length=9) + address = models.CharField( + verbose_name=_("Address"), + max_length=140, + ) + city = models.CharField( + verbose_name=_("City"), + max_length=70, + ) + postal_code = models.CharField( + verbose_name=_("Postcode"), + max_length=20, + ) + province = models.CharField( + verbose_name=_("Province"), + max_length=70, + ) + phone = models.CharField( + verbose_name=_("Phone"), + max_length=20, + ) + phone_2 = models.CharField( + verbose_name=_("Phone 2"), + max_length=20, + blank=True, + ) + notes = models.TextField( + verbose_name=_("Notes"), + blank=True, + ) + contact_id = models.CharField( + max_length=9, + ) date_left = models.DateField(null=True, blank=True) drop_out = models.BooleanField(default=False) # membership applications pending acceptance diff --git a/shipanaro/settings_django.py b/shipanaro/settings_django.py index 47a22d6..573e3c1 100644 --- a/shipanaro/settings_django.py +++ b/shipanaro/settings_django.py @@ -17,8 +17,6 @@ "contenttypes": None, } -# from django.utils.translation import ugettext as _ - # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) @@ -43,6 +41,7 @@ # pirates "humans", "shipanaro", + "shipanaro.gdpr", # django "django.contrib.admin", "django.contrib.auth",