diff --git a/app/models.py b/app/models.py index 060560cd..9deb5929 100644 --- a/app/models.py +++ b/app/models.py @@ -93,8 +93,8 @@ class Instance(db.Model): def known_communities_count(self): return db.session.execute(text(f'SELECT count(*) FROM community WHERE instance_id = {self.id}')).all()[0].count - # def known_users_count(self): - # return db.session.execute(text(f'SELECT count(DISTINCT instance_id) as count FROM USER')).all()[0].count + def known_users_count(self): + return db.session.execute(text(f'SELECT count(*) FROM "user" WHERE instance_id = {self.id}')).all()[0].count def __repr__(self): return ''.format(self.domain) diff --git a/app/templates/admin/instances.html b/app/templates/admin/instances.html index 2b4402db..173aeaf9 100644 --- a/app/templates/admin/instances.html +++ b/app/templates/admin/instances.html @@ -23,6 +23,7 @@ Software Version Communities + Users Posts Post Replies Vote Weight @@ -37,6 +38,7 @@ {{ instance.software }} {{ instance.version if instance.version }} {{ instance.known_communities_count() }} + {{ instance.known_users_count() }} {{ instance.post_count() }} {{ instance.post_replies_count() }} {{ instance.vote_weight }}