diff --git a/carpool/forms.py b/carpool/forms.py index f6dc7b7..f6bd5b4 100644 --- a/carpool/forms.py +++ b/carpool/forms.py @@ -46,7 +46,6 @@ def __init__(self, *args, **kwargs): ) - class filterForm(forms.Form): source = forms.ChoiceField(choices=CHOICES, label="From", initial='', widget=forms.Select()) dest = forms.ChoiceField(choices=CHOICES, label="To", initial='', widget=forms.Select()) diff --git a/carpool/templates/signup.html b/carpool/templates/signup.html index 870aa06..2b0753a 100644 --- a/carpool/templates/signup.html +++ b/carpool/templates/signup.html @@ -57,11 +57,6 @@

Register

--> {{ error }} - {% if done == True %} - - {% endif %}
Already a member? Login Here
diff --git a/carpool/templates/signupcomp.html b/carpool/templates/signupcomp.html new file mode 100644 index 0000000..e32a1c2 --- /dev/null +++ b/carpool/templates/signupcomp.html @@ -0,0 +1,43 @@ + +{% load static %} + + + + + + My ride + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

please check your email. A confirmation link has been sent to you by hackweek@example.com

+ + + \ No newline at end of file diff --git a/carpool/urls.py b/carpool/urls.py index 849f2c2..f901413 100644 --- a/carpool/urls.py +++ b/carpool/urls.py @@ -5,6 +5,7 @@ urlpatterns = [ path('new/', views.new, name="new"), + path('signupcomp/',views.signupcomp, name='signupcomp'), path('', views.dashboard, name="dashboard"), path('add/', views.addPool, name="addPool"), path('log/', views.log, name="log"), diff --git a/carpool/views.py b/carpool/views.py index 9651308..774d4f0 100644 --- a/carpool/views.py +++ b/carpool/views.py @@ -24,14 +24,13 @@ def IITmail(request): def new(request): error="" - done=False if request.user.is_authenticated: return HttpResponseRedirect('/') if request.method == 'POST': form = SignUpForm(request.POST) if not IITmail(request): error+="Please use an IIT Mandi email." - elif not form.is_valid(): + if not form.is_valid(): error+="Invalid information/ Email already in use." else: user = form.save(commit=False) @@ -47,12 +46,15 @@ def new(request): }) to_email = form.cleaned_data.get('email') send_mail(mail_subject, message, 'Hackweek@example.com', [to_email], fail_silently=False) - done=True + return HttpResponseRedirect("/signupcomp/") # email = EmailMessage(mail_subject, message, to=[to_email]) # email.send() else: form = SignUpForm() - return render(request, 'signup.html', {'form': form, 'error': error, 'done': done, }) + return render(request, 'signup.html', {'form': form, 'error': error,}) + +def signupcomp(request): + return render(request,"signupcomp.html") def log(request):