def post(self, request): form = loginForm(request.POST) if not form.is_valid(): return render(request, 'minivideo/login.html', {'form':form}) request.session['stuno'] = request.POST['team_captain_stuno'] request.session.set_expiry(0) return HttpResponseRedirect(reverse('minivideo:resource_list'))
def post(self, request): form = loginForm(request.POST) if not form.is_valid(): return render(request, 'minivideo/login.html', {'form': form}) request.session['stuno'] = request.POST['team_captain_stuno'] request.session.set_expiry(0) return HttpResponseRedirect(reverse('minivideo:resource_list'))
def get(self, request): if 'stuno' in request.session: return HttpResponseRedirect(reverse('minivideo:resource_list')) form = loginForm() return render(request,'minivideo/login.html',{'form':form})
def get(self, request): if 'stuno' in request.session: return HttpResponseRedirect(reverse('minivideo:resource_list')) form = loginForm() return render(request, 'minivideo/login.html', {'form': form})