From 43646b167b8a412c52f72e03b2fbcab85802d55a Mon Sep 17 00:00:00 2001 From: Tom Teichler <tom.teichler@teckids.org> Date: Wed, 18 Nov 2020 20:02:21 +0100 Subject: [PATCH] Make lint clean --- aleksis/core/models.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/aleksis/core/models.py b/aleksis/core/models.py index 4c9c28ea6..78bda3bd1 100644 --- a/aleksis/core/models.py +++ b/aleksis/core/models.py @@ -226,9 +226,9 @@ class Person(ExtensibleModel): def age_at(self, today): if self.date_of_birth: years = today.year - self.date_of_birth.year - if (self.date_of_birth.month > today.month - or (self.date_of_birth.month == today.month - and self.date_of_birth.day > today.day)): + if self.date_of_birth.month > today.month or ( + self.date_of_birth.month == today.month and self.date_of_birth.day > today.day + ): years -= 1 return years @@ -388,14 +388,14 @@ class Group(SchoolTermRelatedExtensibleModel): """ Get stats about a given group """ stats = {} - stats['members'] = len(self.members.all()) + stats["members"] = len(self.members.all()) ages = [person.age for person in self.members.filter(date_of_birth__isnull=False)] if ages: - stats['age_avg'] = sum(ages) / len(ages) - stats['age_range_min'] = min(ages) - stats['age_range_max'] = max(ages) + stats["age_avg"] = sum(ages) / len(ages) + stats["age_range_min"] = min(ages) + stats["age_range_max"] = max(ages) return stats -- GitLab