mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-07-03 06:42:48 +02:00
Upload all authorizations
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
# Copyright (C) 2020 by Animath
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from datetime import date
|
||||
|
||||
from address.models import AddressField
|
||||
from django.contrib.sites.models import Site
|
||||
from django.db import models
|
||||
@ -73,7 +75,7 @@ class Registration(PolymorphicModel):
|
||||
|
||||
@property
|
||||
def participates(self):
|
||||
return isinstance(self, StudentRegistration) or isinstance(self, CoachRegistration)
|
||||
return isinstance(self, ParticipantRegistration)
|
||||
|
||||
@property
|
||||
def is_admin(self):
|
||||
@ -119,7 +121,7 @@ class ParticipantRegistration(Registration):
|
||||
|
||||
birth_date = models.DateField(
|
||||
verbose_name=_("birth date"),
|
||||
default=timezone.now,
|
||||
default=date.today,
|
||||
)
|
||||
|
||||
address = AddressField(
|
||||
@ -147,6 +149,10 @@ class ParticipantRegistration(Registration):
|
||||
default="",
|
||||
)
|
||||
|
||||
@property
|
||||
def under_18(self):
|
||||
return (timezone.now().date() - self.birth_date).days < 18 * 365.24
|
||||
|
||||
@property
|
||||
def type(self): # pragma: no cover
|
||||
raise NotImplementedError
|
||||
|
Reference in New Issue
Block a user