Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Don't add deactivated members to inactivity report

Roland Geider977ed494f3a5
diff --git a/wger/gym/management/commands/inactive-members.py b/wger/gym/management/commands/inactive-members.py
index b20766485..9e29dc45e 100644
--- a/wger/gym/management/commands/inactive-members.py
+++ b/wger/gym/management/commands/inactive-members.py
@@ -58,6 +58,11 @@ class Command(BaseCommand):
for profile in gym.userprofile_set.all():
user = profile.user
+ # check if the account was deactivated (user can't login)
+ if not user.is_active:
+ continue
+
+ # add to trainer list that will be notified
if user.has_perm('gym.gym_trainer'):
trainer_list.append(user)