diff --git a/backend/core/management/commands/status.py b/backend/core/management/commands/status.py index 0a7a92d27..7a4fd2591 100644 --- a/backend/core/management/commands/status.py +++ b/backend/core/management/commands/status.py @@ -23,7 +23,9 @@ def handle(self, *args, **kwargs): nb_risk_acceptances = RiskAcceptance.objects.all().count() created_at = Folder.get_root_folder().created_at last_login = max( - x["last_login"] for x in User.objects.all().values("last_login") + x["last_login"] + for x in User.objects.all().values("last_login") + if x["last_login"] ) self.stdout.write( f"created_at={created_at.strftime('%Y-%m-%dT%H:%M')} last_login={last_login.strftime('%Y-%m-%dT%H:%M') if last_login else last_login} "