aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--server/views.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/server/views.py b/server/views.py
index 9babb92..8b1d4fd 100644
--- a/server/views.py
+++ b/server/views.py
@@ -119,9 +119,8 @@ def uapprove(request):
data = []
if request.method == "POST":
# get group name and obj
- parent_group = request.user.groups.values_list('name', flat=True)[
- 0]
- group = Group.objects.get(name=parent_group)
+ group = getGroups(request.user)[0]
+ parent_group = group.name
# get permission object
permission = Permission.objects.get(codename='approved')
@@ -423,7 +422,7 @@ def ulist(request):
# 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__contains=group).select_related("user", "medic").order_by("user__last_name")
+ 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"]