From 2a8c89a1a6e39854b0e9d341db578215496b346c Mon Sep 17 00:00:00 2001 From: Andrea Lepori Date: Mon, 16 Aug 2021 14:54:06 +0200 Subject: remove unused import and variables --- server/admin.py | 2 +- server/models.py | 2 +- server/views.py | 19 +------------------ 3 files changed, 3 insertions(+), 20 deletions(-) (limited to 'server') diff --git a/server/admin.py b/server/admin.py index 8c38f3f..5538909 100644 --- a/server/admin.py +++ b/server/admin.py @@ -1,3 +1,3 @@ -from django.contrib import admin +#from django.contrib import admin # Register your models here. diff --git a/server/models.py b/server/models.py index 71a8362..54f60fe 100644 --- a/server/models.py +++ b/server/models.py @@ -1,3 +1,3 @@ -from django.db import models +#from django.db import models # Create your models here. diff --git a/server/views.py b/server/views.py index 244bf60..56b1a77 100644 --- a/server/views.py +++ b/server/views.py @@ -1,5 +1,5 @@ from django.shortcuts import render -from client.models import MedicalData, UserCode, Keys, DocumentType, Document, KeyVal +from client.models import UserCode, Keys, DocumentType, Document, KeyVal from django.conf import settings from django.core.mail import send_mail from client.models import GroupSettings, UserCode, Keys, DocumentType, Document, KeyVal @@ -13,7 +13,6 @@ from django.contrib.admin.views.decorators import staff_member_required from django.contrib.auth.decorators import user_passes_test from django.contrib.contenttypes.models import ContentType from django.contrib.sessions.backends.db import SessionStore -from django import template import csv import dateparser @@ -22,13 +21,11 @@ from datetime import timedelta import pytz import pdfkit from io import BytesIO -import os import base64 from PIL import Image, UnidentifiedImageError import zipfile import json import threading -import random # custom staff check function for non primary group staff members def isStaff(user): @@ -182,11 +179,6 @@ def docapprove(request): context = {} data = [] - # group name and obj - parent_group = request.user.groups.values_list('name', flat=True)[ - 0] - group = Group.objects.get(name=parent_group) - # if user not staff of primary has only controll of non primary groups if request.user.is_staff: groups = request.user.groups.values_list('name', flat=True) @@ -317,7 +309,6 @@ def ulist(request): # generate link for images vac_file = "" health_file = "" - sign_doc_file = "" if usercode.medic: if usercode.medic.vac_certificate.name: vac_file = "/server/media/" + str(usercode.id) + "/vac_certificate/usercode" @@ -566,11 +557,6 @@ def doctype(request): message = True group_bool = True - # group name and obj - parent_group = request.user.groups.values_list('name', flat=True)[ - 0] - group = Group.objects.get(name=parent_group) - # get documents from the list q_obj = Q() for i in parent_groups: @@ -1459,9 +1445,6 @@ def zip_documents(docs, session_key): @user_passes_test(isStaff) def upload_doc(request): # setup group based on staff primary or not - parent_group = request.user.groups.values_list('name', flat=True)[ - 0] - group = Group.objects.get(name=parent_group) if request.user.is_staff: groups = request.user.groups.values_list('name', flat=True) else: -- cgit v1.2.1