I'm trying to see where a Python syntax error would be hiding. Both Django and pylint claim a syntax error at custom.py:41. Lines 41-42 read:
(reading_threshold =int(request.POST['reading_threshold']))
I do not see anything that I can notice as wrong in that statement or the syntax in custom.py.
What is my mistake here?
A slightly sanitized version of the file reads:
from django.http import HttpResponsedef threshold_check(user, item, text = None):if user.issuperuser():if text == None:return Trueelse:return textelse:if (user.status >= item.threshold and user.reading_threshold <=item.threshold):if text == None:return Trueelse:return textelse:if text == None:return Falseelse:return ''def threshold_check_required(item):def outer_wrap(view_function):def inner_wrap(request, *arguments, **keywords):if request.user.issuperuser():return view_function(request, *arguments, **keywords)else:if (request.user.status >= item.threshold andrequest.user.reading_threshold <= item.threshold):return view_function(request, *arguments, **keywords)else:return HttpResponse('')return inner_wrapreturn outer_wrapdef threshold_controls(request):user = request.userif user and user.status != None:if request.method == 'POST':try:(reading_threshold =int(request.POST['reading_threshold']))except ValueError:reading_threshold = user.reading_thresholdtry:(writing_threshold =int(request.POST['writing_threshold']))except ValueError:writing_threshold = user.writing_thresholdwriting_threshold = min(user.status, writing_threshold)reading_threshold = min(writing_threshold,reading_threshold)user.reading_threshold = reading_threshholduser.writing_threshold = writing_thresholduser.save()return render_to_response('threshold_controls.html',{'user': user})else:return render_to_response('threshold_controls_blank.html')