aboutsummaryrefslogtreecommitdiffstats
path: root/accounts
diff options
context:
space:
mode:
authorAndrea Lepori <alepori@student.ethz.ch>2020-06-23 19:05:09 +0200
committerAndrea Lepori <alepori@student.ethz.ch>2020-06-23 19:05:09 +0200
commit684c019daf76b499417c85e4ea5877a96b0ddb0e (patch)
treea87fbd3ed23d41dfc1a0a1996803a1e6a6e5541a /accounts
parentDownload docs, better preview (diff)
downloadscout-subs-684c019daf76b499417c85e4ea5877a96b0ddb0e.tar.gz
scout-subs-684c019daf76b499417c85e4ea5877a96b0ddb0e.zip
Nicer user list, multi group support
Diffstat (limited to 'accounts')
-rw-r--r--accounts/views.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/accounts/views.py b/accounts/views.py
index 9c2efeb..7b40c05 100644
--- a/accounts/views.py
+++ b/accounts/views.py
@@ -81,10 +81,11 @@ def personal(request):
medic.misc = request.POST["misc"]
medic.save()
- if request.POST["branca"] != "":
- request.user.groups.clear()
- request.user.groups.add(
- Group.objects.get(name=request.POST["branca"]))
+ if "branca" in request.POST:
+ if request.POST["branca"] != "":
+ request.user.groups.clear()
+ request.user.groups.add(
+ Group.objects.get(name=request.POST["branca"]))
if "vac_certificate" in request.FILES:
myfile = request.FILES['vac_certificate']