mirror of
https://github.com/umap-project/umap.git
synced 2025-05-16 10:41:52 +02:00
Compare commits
No commits in common. "3b195e562af6b7c0cc5cc35c5f520e76babeca14" and "7a2bf9fc4cc86a732b391c018dcb13d0f5eaf516" have entirely different histories.
3b195e562a
...
7a2bf9fc4c
2 changed files with 0 additions and 19 deletions
|
@ -185,10 +185,6 @@ def test_stats_empty(client):
|
|||
"users_count": 0,
|
||||
"active_sessions": 0,
|
||||
"version": VERSION,
|
||||
"editors_count": 0,
|
||||
"members_count": 0,
|
||||
"orphans_count": 0,
|
||||
"owners_count": 0,
|
||||
}
|
||||
|
||||
|
||||
|
@ -206,10 +202,6 @@ def test_stats_basic(client, map, datalayer, user2):
|
|||
"users_count": 2,
|
||||
"active_sessions": 0,
|
||||
"version": VERSION,
|
||||
"editors_count": 0,
|
||||
"members_count": 0,
|
||||
"orphans_count": 1,
|
||||
"owners_count": 1,
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1372,13 +1372,6 @@ class PictogramJSONList(ListView):
|
|||
|
||||
def stats(request):
|
||||
last_week = make_aware(datetime.now()) - timedelta(days=7)
|
||||
users = User.objects.values_list("pk", flat=True)
|
||||
owners = set(
|
||||
Map.objects.filter(owner__isnull=False).values_list("owner", flat=True)
|
||||
)
|
||||
editors = set(Map.editors.through.objects.values_list("user_id", flat=True))
|
||||
members = set(Team.users.through.objects.values_list("user_id", flat=True))
|
||||
orphans = set(users) - owners - editors - members
|
||||
return simple_json_response(
|
||||
**{
|
||||
"version": VERSION,
|
||||
|
@ -1393,10 +1386,6 @@ def stats(request):
|
|||
"active_sessions": Session.objects.filter(
|
||||
expire_date__gt=datetime.utcnow()
|
||||
).count(),
|
||||
"owners_count": len(owners),
|
||||
"editors_count": len(editors),
|
||||
"members_count": len(members),
|
||||
"orphans_count": len(orphans),
|
||||
}
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in a new issue