Commit 1264bed4 authored by Samarth Joshi's avatar Samarth Joshi

Signup.html Redirect to homepage if user already signed in

parent 64685e29
......@@ -44,6 +44,9 @@
flex-direction: column;
align-items: center;
}
.emptiness > img {
height: 200px;
}
.heading {
width: 400px;
margin: 50px auto;
......
......@@ -231,6 +231,8 @@ def create_quiz(request):
#login functionality
def sign_up(request):
"""This function renders the sign up page for the users"""
if request.user.is_authenticated:
return HttpResponseRedirect('/')
context = {}
form = UserCreationForm(request.POST or None)
if request.method == "POST":
......@@ -241,9 +243,7 @@ def sign_up(request):
if role == "P":
p = Permission(userId=request.user, role="P")
p.save()
return render(request,'professor.html')
else:
return render(request,'student.html')
return HttpResponseRedirect('/')
context['form']=form
return render(request,'registration/signup.html',context)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment