aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrea Lepori <alepori@student.ethz.ch>2022-09-13 19:49:46 +0200
committerAndrea Lepori <alepori@student.ethz.ch>2022-09-13 19:49:46 +0200
commit4fcf257ad37fad25db594c366dfbcf93ab3bf317 (patch)
tree193d998899028130a9f82e9b58a2e01dfa8de1be
parentpermit multiple documents of the same type (diff)
downloadscout-subs-4fcf257ad37fad25db594c366dfbcf93ab3bf317.tar.gz
scout-subs-4fcf257ad37fad25db594c366dfbcf93ab3bf317.zip
remove unused/useless code
Diffstat (limited to '')
-rw-r--r--accounts/views.py3
-rw-r--r--client/views.py7
-rw-r--r--server/views.py13
-rw-r--r--static/utils.js1
-rw-r--r--version.txt2
5 files changed, 10 insertions, 16 deletions
diff --git a/accounts/views.py b/accounts/views.py
index 22e287e..959fa28 100644
--- a/accounts/views.py
+++ b/accounts/views.py
@@ -44,7 +44,7 @@ MIDATA_ENABLED = settings.OAUTH_ENABLED
# override to remove help text
class RegisterForm(UserCreationForm):
def __init__(self, *args, **kwargs):
- super(RegisterForm, self).__init__(*args, **kwargs)
+ super(UserCreationForm, self).__init__(*args, **kwargs)
for fieldname in ['username', 'password1', 'password2']:
self.fields[fieldname].help_text = None
@@ -119,7 +119,6 @@ class CustomLoginView(LoginView):
# check if user has a cookie saved
response = HttpResponseRedirect("/")
- sessions = dict()
# no cookie
if "user_switcher" not in request.COOKIES:
return super(CustomLoginView, self).get(request, *args, **kwargs)
diff --git a/client/views.py b/client/views.py
index 4cb3d3d..bf2a641 100644
--- a/client/views.py
+++ b/client/views.py
@@ -1,17 +1,16 @@
from django.db.models.expressions import OuterRef, Subquery
from django.template.loader import get_template
from django.urls import reverse
-from client.models import GroupSettings, UserCode, Keys, DocumentType, Document, PersonalData, KeyVal, MedicalData
+from client.models import UserCode, Keys, DocumentType, Document, PersonalData, KeyVal, MedicalData
from django.db.models import Q
-from django.http import HttpResponse, HttpResponseRedirect, FileResponse
+from django.http import HttpResponseRedirect, FileResponse
from django.contrib.auth.decorators import login_required
from django.shortcuts import render
from accounts.views import copy_from_midata
-from django.conf import Settings, settings
+from django.conf import settings
from io import BytesIO
import pdfkit
-from subprocess import check_output
from datetime import datetime
import pytz
from random import randint
diff --git a/server/views.py b/server/views.py
index 56a05ec..4133d3c 100644
--- a/server/views.py
+++ b/server/views.py
@@ -300,8 +300,6 @@ def approve_direct(request):
else:
groups = request.user.groups.values_list('name', flat=True)[1:]
- doc_code = -1
-
if request.method == "POST" and "doc_code" in request.POST:
# if user submitted the form to approve a document
doc_code = request.POST["doc_code"]
@@ -761,10 +759,9 @@ def custom_parameters_preview(request):
dic = {}
val = params[i]
if val.startswith("!"):
- if len(val) < 3:
- val = val
+ if len(val) >= 3:
+ val = val[3:].split(",")[0]
- val = val[3:].split(",")[0]
dic["key"] = val
dic["key_extra"] = params[i]
dic["id"] = i
@@ -888,10 +885,8 @@ def doccreate(request):
for i in custom:
val = i
if val.startswith("!"):
- if len(val) < 3:
- val = val
-
- val = val[3:].split(",")[0]
+ if len(val) >= 3:
+ val = val[3:].split(",")[0]
key = Keys(key=val, key_extra=i, container=doctype)
key.save()
diff --git a/static/utils.js b/static/utils.js
index 0545d15..3220030 100644
--- a/static/utils.js
+++ b/static/utils.js
@@ -13,6 +13,7 @@ function initMaterializeHelper(customOptions) {
if (options.selectOptions)
fixSelectOptions(options.debug)
+ if (options.selectOptions)
fixNavbarDropdown(options.debug)
if (options.selectTriggers)
fixSelectTriggers(options.debug)
diff --git a/version.txt b/version.txt
index 78ab950..13e827c 100644
--- a/version.txt
+++ b/version.txt
@@ -1,2 +1,2 @@
version=0.6
-rev=4
+rev=5