diff options
author | Andrea Lepori <alepori@student.ethz.ch> | 2020-06-23 19:05:09 +0200 |
---|---|---|
committer | Andrea Lepori <alepori@student.ethz.ch> | 2020-06-23 19:05:09 +0200 |
commit | 684c019daf76b499417c85e4ea5877a96b0ddb0e (patch) | |
tree | a87fbd3ed23d41dfc1a0a1996803a1e6a6e5541a /client/views.py | |
parent | Download docs, better preview (diff) | |
download | scout-subs-684c019daf76b499417c85e4ea5877a96b0ddb0e.tar.gz scout-subs-684c019daf76b499417c85e4ea5877a96b0ddb0e.zip |
Nicer user list, multi group support
Diffstat (limited to '')
-rw-r--r-- | client/views.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/client/views.py b/client/views.py index b43a3c9..17d9e0a 100644 --- a/client/views.py +++ b/client/views.py @@ -92,7 +92,7 @@ def approve(request): if not (request.user.is_staff or request.user.has_perm('approved')): usercode = UserCode.objects.filter(user=request.user)[0] okay = False - if request.user.first_name != "" and request.user.last_name != "" and request.user.email != "" and len(request.user.groups.values_list('name', flat=True)) != 0: + if request.user.first_name != "" and request.user.last_name != "" and request.user.email != "" and usercode.phone != "": okay = True context = {'code': 'U' + str(usercode.code), 'okay': okay} return render(request, 'client/approve.html', context) @@ -162,7 +162,7 @@ def create(request): break document = Document( - user=request.user, group=group, code=code, status=status, document_type=document_type, personal_data=personal_data, medical_data=medical_data) + user=request.user, group=document_type.group, code=code, status=status, document_type=document_type, personal_data=personal_data, medical_data=medical_data) document.save() if document_type.custom_data: |