Skip to content

Commit

Permalink
Update status.py
Browse files Browse the repository at this point in the history
improve instance status (python manage.py status)
  • Loading branch information
eric-intuitem committed Apr 24, 2024
1 parent 7a61562 commit 47e603e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion backend/core/management/commands/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@ def handle(self, *args, **kwargs):
nb_risk_assessments = RiskAssessment.objects.all().count()
nb_risk_scenarios = RiskScenario.objects.all().count()
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'))
self.stdout.write(
f"users={nb_users} first_logins={nb_first_login} libraries={nb_libraries} "
f"created_at={created_at.strftime('%Y-%m-%dT%H:%M')} last_login={last_login.strftime('%Y-%m-%dT%H:%M')} "
+ f"users={nb_users} first_logins={nb_first_login} libraries={nb_libraries} "
+ f"domains={nb_domains} projects={nb_projects} assets={nb_assets} "
+ f"threats={nb_threats} functions={nb_functions} measures={nb_measures} "
+ f"evidences={nb_evidences} compliance={nb_compliance_assessments} risk={nb_risk_assessments} "
Expand Down

0 comments on commit 47e603e

Please sign in to comment.