hassan11196 / QRSMS-V1

Consider using in PYL-R1714
Performance
Major
3 years ago4 years old
Consider merging these comparisons with "in" to "scsddc in (None, '', 'null')"
573    #grading_type = request.POST['Type']
574    scheme = 0
575    scsddc = request.POST['scsddc']
576    if scsddc == None or scsddc == "" or scsddc == "null":577        return JsonResponse({"Error": "Invalid scsddc"}, status=403)
578    csection = CourseSection.objects.get(scsddc=scsddc)
579    for student_info in csection.student_info.all():
Consider merging these comparisons with "in" to "scsddc in (None, '', 'null')"
529def marks_info(request):
530    scsddc = request.POST['scsddc']
531    print(scsddc)
532    if scsddc == None or scsddc == "" or scsddc == "null":533        return JsonResponse({"Failed": "Invalid Input Parameters"}, status=403)
534    print(scsddc)
535    marks = SectionMarks.objects.filter(scsddc=scsddc).values()
Consider merging these comparisons with "in" to "'' in (username, password)"
474    def post(self, request, *args, **kwargs):
475        username = request.POST['username']
476        password = request.POST['password']
477        if username == "" or password == "":478            return Response(data="Empty Usename or Password Field.", status=400)
479
480        user = authenticate(request, username=username, password=password)