Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue#17 #18

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion carpool/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
5 changes: 0 additions & 5 deletions carpool/templates/signup.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,6 @@ <h2>Register</h2>
</div>
</form> -->
{{ error }}
{% if done == True %}
<script>
alert("Please check your mail. A confirmation Email has been sent to the given id.");
</script>
{% endif %}
<h5>Already a member? <a href="{% url 'log' %}">Login Here</a></h5>
</div>
</div>
Expand Down
43 changes: 43 additions & 0 deletions carpool/templates/signupcomp.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<html class="not-ie no-js" lang="en">
{% load static %}

<head>

<!-- Basic Page Needs -->
<meta charset="utf-8">
<title>My ride</title>
<meta name="description" content="">
<meta name="author" content="">
<meta http-equiv="X-UA-Compatible" content="IE=edge">

<!-- Mobile Specific Metas -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<!-- Styles -->

<!-- Bootstrap -->
<link href="{% static 'css/bootstrap.min.css' %}" rel="stylesheet">
<!-- Forms -->
<link href="{% static 'css/jquery.idealforms.css' %}" rel="stylesheet">
<!-- Select -->
<link href="{% static 'css/jquery.idealselect.css' %}" rel="stylesheet">
<!-- Slicknav -->
<link href="{% static 'css/slicknav.css' %}" rel="stylesheet">
<!-- Main style -->
<link href="{% static 'css/styles.css' %}" rel="stylesheet">

<!-- Modernizr -->
<script src="{% static 'js/modernizr.js' %}"></script>

<!-- Fonts -->
<link href="{% static 'css/font-awesome.min.css' %}" rel="stylesheet">
<link href='http://fonts.googleapis.com/css?family=Montserrat' rel='stylesheet' type='text/css'>
<link rel="shortcut icon" type="image/ico" href="{% static 'img/favicon.ico' %}"/>

</head>

<body>
<h1>please check your email. A confirmation link has been sent to you by [email protected]</h1>
</body>

</html>
1 change: 1 addition & 0 deletions carpool/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
10 changes: 6 additions & 4 deletions carpool/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -47,12 +46,15 @@ def new(request):
})
to_email = form.cleaned_data.get('email')
send_mail(mail_subject, message, '[email protected]', [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, })
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is better to have a combined render rather than using the same code three times, just remove the done variable.

return render(request, 'signup.html', {'form': form, 'error': error,})

def signupcomp(request):
return render(request,"signupcomp.html")


def log(request):
Expand Down