aboutsummaryrefslogtreecommitdiffstats
path: root/server/views.py
diff options
context:
space:
mode:
authorAndrea Lepori <aleporia@gmail.com>2023-02-23 13:04:50 +0100
committerAndrea Lepori <aleporia@gmail.com>2023-02-23 13:05:10 +0100
commite489173e7ccbe7593e263b705c7937ff5be62b10 (patch)
tree929c2d90eb06cd652b9236006c97cb31a4e6922f /server/views.py
parentfix missing variable for medic export (diff)
downloadscout-subs-e489173e7ccbe7593e263b705c7937ff5be62b10.tar.gz
scout-subs-e489173e7ccbe7593e263b705c7937ff5be62b10.zip
add prototype for table of users
Diffstat (limited to 'server/views.py')
-rw-r--r--server/views.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/server/views.py b/server/views.py
index 0ba3f63..66fa1c7 100644
--- a/server/views.py
+++ b/server/views.py
@@ -458,6 +458,27 @@ def ulist(request):
}
return render(request, 'server/user_list.html', context)
+@staff_member_required
+def ulist_table(request):
+ context = {}
+ # group name and obj
+ group = getGroups(request)[0]
+
+ # list users with their documents
+ permission = Permission.objects.get(codename="approved")
+
+ usercodes = UserCode.objects.filter(Q(user__user_permissions=permission) | Q(user__is_staff=True)).filter(user__groups__name__contains=group.name).select_related("user", "medic").order_by("user__last_name")
+
+ vac_file = ["/server/media/", "/vac_certificate/usercode"]
+ health_file = ["/server/media/", "/health_care_certificate/usercode"]
+
+ context = {
+ 'users': usercodes,
+ 'vac_file': vac_file,
+ 'health_file': health_file,
+ }
+ return render(request, 'server/user_list_table.html', context)
+
@user_passes_test(isStaff)
def doctype(request):