1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-07-03 06:42:48 +02:00

Address, responsible and phone number were missing. Use Google Maps API to query the address, to ensure to have valid addresses

This commit is contained in:
Yohann D'ANELLO
2020-12-28 23:59:21 +01:00
parent 95fec7c0da
commit 72753edf64
10 changed files with 118 additions and 11 deletions

View File

@ -1,14 +1,17 @@
# Copyright (C) 2020 by Animath
# SPDX-License-Identifier: GPL-3.0-or-later
from address.models import AddressField
from django.contrib.sites.models import Site
from django.db import models
from django.template import loader
from django.urls import reverse_lazy
from django.utils import timezone
from django.utils.crypto import get_random_string
from django.utils.encoding import force_bytes
from django.utils.http import urlsafe_base64_encode
from django.utils.translation import gettext_lazy as _
from phonenumber_field.modelfields import PhoneNumberField
from polymorphic.models import PolymorphicModel
from tfjm.tokens import email_validation_token
@ -114,6 +117,22 @@ class ParticipantRegistration(Registration):
verbose_name=_("team"),
)
birth_date = models.DateField(
verbose_name=_("birth date"),
default=timezone.now,
)
address = AddressField(
verbose_name=_("address"),
null=True,
default=None,
)
phone_number = PhoneNumberField(
verbose_name=_("phone number"),
blank=True,
)
photo_authorization = models.FileField(
verbose_name=_("photo authorization"),
upload_to=get_random_photo_filename,
@ -156,6 +175,22 @@ class StudentRegistration(ParticipantRegistration):
verbose_name=_("school"),
)
responsible_name = models.CharField(
max_length=255,
verbose_name=_("responsible name"),
default="",
)
responsible_phone = PhoneNumberField(
verbose_name=_("responsible phone number"),
blank=True,
)
responsible_email = models.EmailField(
verbose_name=_("responsible email address"),
default="",
)
parental_authorization = models.FileField(
verbose_name=_("parental authorization"),
upload_to=get_random_parental_filename,