Skip to content
Snippets Groups Projects
Verified Commit 43646b16 authored by Tom Teichler's avatar Tom Teichler :beers:
Browse files

Make lint clean

parent 07a84ad4
No related branches found
No related tags found
No related merge requests found
Pipeline #4672 passed
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment