aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrea Lepori <alepori@student.ethz.ch>2021-08-18 16:00:24 +0200
committerAndrea Lepori <alepori@student.ethz.ch>2021-08-18 16:00:34 +0200
commit24dc119cdcd09c5ec3ff5ace3efb8f31c7e3de15 (patch)
treeaca8d95518b994233679520742845703967a0827
parentcorrect primary group on doc export (diff)
downloadscout-subs-24dc119cdcd09c5ec3ff5ace3efb8f31c7e3de15.tar.gz
scout-subs-24dc119cdcd09c5ec3ff5ace3efb8f31c7e3de15.zip
fix group change and ucode parsing
-rw-r--r--server/views.py6
-rw-r--r--version.txt2
2 files changed, 4 insertions, 4 deletions
diff --git a/server/views.py b/server/views.py
index d598f93..d34ebb3 100644
--- a/server/views.py
+++ b/server/views.py
@@ -137,10 +137,10 @@ def uapprove(request):
# parse text to array
data = request.POST["codes"]
- data.replace("\r", "")
data = data.split("\n")
# check if format is right
for i in range(len(data)):
+ data[i] = data[i].replace("\r", "")
if not data[i].startswith("U"):
data[i] = data[i] + " - Formato errato"
elif not data[i][1:].isdigit():
@@ -159,10 +159,10 @@ def uapprove(request):
else:
if user.groups.values_list('name', flat=True)[0] == parent_group:
# if user already in group do nothing
- data[i] = data[i] + " - Ok"
+ data[i] = data[i] + " - GiĆ  approvato"
else:
# if user in another group notify staff of group change
- user.groups.clear()
+ user.groups.remove(Group.objects.get(name=user.groups.values_list('name', flat=True)[0]))
user.groups.add(group)
data[i] = data[i] + " - Ok, cambio branca"
diff --git a/version.txt b/version.txt
index 05d2f8e..5bb24a7 100644
--- a/version.txt
+++ b/version.txt
@@ -1,2 +1,2 @@
version=0.3
-rev=7
+rev=8