mirror of
https://github.com/umap-project/umap.git
synced 2025-05-16 18:51:51 +02:00
Compare commits
6 commits
9974852975
...
0d6326a7aa
Author | SHA1 | Date | |
---|---|---|---|
![]() |
0d6326a7aa | ||
![]() |
9414d6220c | ||
![]() |
5d1f5de551 | ||
![]() |
1981f73212 | ||
![]() |
434de70c02 | ||
![]() |
c5eac8a8a9 |
3 changed files with 8 additions and 2 deletions
|
@ -33,11 +33,11 @@ dependencies = [
|
|||
"django-environ==0.12.0",
|
||||
"django-probes==1.7.0",
|
||||
"Pillow==11.1.0",
|
||||
"psycopg==3.2.4",
|
||||
"psycopg==3.2.5",
|
||||
"requests==2.32.3",
|
||||
"rcssmin==1.2.1",
|
||||
"rjsmin==1.2.4",
|
||||
"social-auth-core==4.5.4",
|
||||
"social-auth-core==4.5.6",
|
||||
"social-auth-app-django==5.4.2",
|
||||
]
|
||||
|
||||
|
|
|
@ -183,6 +183,7 @@ def test_stats_empty(client):
|
|||
"maps_count": 0,
|
||||
"users_active_last_week_count": 0,
|
||||
"users_count": 0,
|
||||
"active_sessions": 0,
|
||||
"version": VERSION,
|
||||
}
|
||||
|
||||
|
@ -199,6 +200,7 @@ def test_stats_basic(client, map, datalayer, user2):
|
|||
"maps_count": 1,
|
||||
"users_active_last_week_count": 1,
|
||||
"users_count": 2,
|
||||
"active_sessions": 0,
|
||||
"version": VERSION,
|
||||
}
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ from django.contrib.auth import BACKEND_SESSION_KEY, get_user_model
|
|||
from django.contrib.auth import logout as do_logout
|
||||
from django.contrib.gis.measure import D
|
||||
from django.contrib.postgres.search import SearchQuery, SearchVector
|
||||
from django.contrib.sessions.models import Session
|
||||
from django.contrib.staticfiles.storage import staticfiles_storage
|
||||
from django.core.exceptions import PermissionDenied
|
||||
from django.core.mail import send_mail
|
||||
|
@ -1382,6 +1383,9 @@ def stats(request):
|
|||
"users_active_last_week_count": User.objects.filter(
|
||||
last_login__gt=last_week
|
||||
).count(),
|
||||
"active_sessions": Session.objects.filter(
|
||||
expire_date__gt=datetime.utcnow()
|
||||
).count(),
|
||||
}
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in a new issue