Merge branch 'master' into 'master'

Change school year to start on August 15th instead of August 1st

See merge request bocal/site!2
This commit is contained in:
Théophile Bastian 2024-08-17 17:28:34 +02:00
commit 370eb07d8c

View file

@ -102,7 +102,7 @@ class Publication(models.Model):
class PublicationYear(models.Model): class PublicationYear(models.Model):
startYear = IntegerField('Année de début', startYear = IntegerField('Année de début',
help_text='Année scolaire à partir du 1/08', help_text='Année scolaire à partir du 15/08',
primary_key=True) primary_key=True)
descr = MarkdownxField("Accroche de l'année (Markdown)") descr = MarkdownxField("Accroche de l'année (Markdown)")
@ -111,11 +111,11 @@ class PublicationYear(models.Model):
def beg(self): def beg(self):
''' First day of this publication year (incl.) ''' ''' First day of this publication year (incl.) '''
return datetime.date(self.startYear, 8, 1) return datetime.date(self.startYear, 8, 15)
def end(self): def end(self):
''' Last day of this publication year (excl.) ''' ''' Last day of this publication year (excl.) '''
return datetime.date(self.startYear + 1, 8, 1) return datetime.date(self.startYear + 1, 8, 15)
def inYear(self, date): def inYear(self, date):
return self.beg() <= date < self.end() return self.beg() <= date < self.end()