summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--workshop_app/templates/workshop_app/password_change_done.html10
-rw-r--r--workshop_app/templates/workshop_app/password_reset_done.html10
-rw-r--r--workshop_app/templates/workshop_app/password_reset_form.html6
-rw-r--r--workshop_app/templates/workshop_app/registration/register.html (renamed from workshop_app/templates/workshop_app/register.html)0
-rw-r--r--workshop_app/views.py19
5 files changed, 33 insertions, 12 deletions
diff --git a/workshop_app/templates/workshop_app/password_change_done.html b/workshop_app/templates/workshop_app/password_change_done.html
index 45c8162..fc87389 100644
--- a/workshop_app/templates/workshop_app/password_change_done.html
+++ b/workshop_app/templates/workshop_app/password_change_done.html
@@ -1,6 +1,9 @@
{% extends "base.html" %}
-{% block pagetitle %}Password change successful{% endblock %}
+{% block pagetitle %}
+ Password change successful
+{% endblock %}
+
{% block script %}
<script type="text/javascript">
window.setTimeout(function()
@@ -9,7 +12,8 @@
}, 2000);
</script>
{% endblock %}
+
{% block content %}
-<h3>Your password has been changed successfully.</h3>
-<h4>Redirecting ...</h4>
+ <h3>Your password has been changed successfully.</h3>
+ <h4>Redirecting ...</h4>
{% endblock %}
diff --git a/workshop_app/templates/workshop_app/password_reset_done.html b/workshop_app/templates/workshop_app/password_reset_done.html
index 1ac7b60..7b4f09a 100644
--- a/workshop_app/templates/workshop_app/password_reset_done.html
+++ b/workshop_app/templates/workshop_app/password_reset_done.html
@@ -1,3 +1,9 @@
{% extends "base.html" %}
-{% block title %}Password reset successful{% endblock %}
-{% block pagetitle %} Instruction for setting new password has been mailed to your registered email address {% endblock %}
+
+{% block title %}
+ Password reset successful
+{% endblock %}
+
+{% block pagetitle %}
+ Instruction for setting new password has been mailed to your registered email address
+{% endblock %}
diff --git a/workshop_app/templates/workshop_app/password_reset_form.html b/workshop_app/templates/workshop_app/password_reset_form.html
index fa14e9e..8a7c09d 100644
--- a/workshop_app/templates/workshop_app/password_reset_form.html
+++ b/workshop_app/templates/workshop_app/password_reset_form.html
@@ -1,5 +1,9 @@
{% extends "base.html" %}
-{% block pagetitle %} Email will be send to the registered email address {% endblock %}
+
+{% block pagetitle %}
+ Email will be send to the registered email address
+{% endblock %}
+
{% block content %}
<form action="" method="post">
{% csrf_token %}
diff --git a/workshop_app/templates/workshop_app/register.html b/workshop_app/templates/workshop_app/registration/register.html
index 6804ad0..6804ad0 100644
--- a/workshop_app/templates/workshop_app/register.html
+++ b/workshop_app/templates/workshop_app/registration/register.html
diff --git a/workshop_app/views.py b/workshop_app/views.py
index 59500d6..ffd6185 100644
--- a/workshop_app/views.py
+++ b/workshop_app/views.py
@@ -1,3 +1,4 @@
+
from .forms import (
UserRegistrationForm, UserLoginForm,
ProfileForm, CreateWorkshop,
@@ -137,7 +138,7 @@ def activate_user(request, key=None):
def user_register(request):
- '''User Registeration form'''
+ '''User Registration form'''
if request.method == 'POST':
form = UserRegistrationForm(request.POST)
if form.is_valid():
@@ -157,7 +158,7 @@ def user_register(request):
if request.user.is_authenticated():
return redirect('/view_profile/')
return render(
- request, "workshop_app/register.html",
+ request, "workshop_app/registration/register.html",
{"form": form}
)
else:
@@ -166,7 +167,7 @@ def user_register(request):
elif request.user.is_authenticated():
return render(request, 'workshop_app/activation.html')
form = UserRegistrationForm()
- return render(request, "workshop_app/register.html", {"form": form})
+ return render(request, "workshop_app/registration/register.html", {"form": form})
#This is shown to coordinator for booking workshops
@@ -673,9 +674,15 @@ def propose_workshop(request):
if form.is_valid():
form_data = form.save(commit=False)
form_data.proposed_workshop_coordinator = user
- form_data.proposed_workshop_coordinator.save()
- form_data.save()
- return redirect('/my_workshops/')
+ #Avoiding Duplicate workshop entries for same date and workshop_title
+ if ProposeWorkshopDate.objects.filter(proposed_workshop_date=form_data.proposed_workshop_date,
+ proposed_workshop_title=form_data.proposed_workshop_title,
+ proposed_workshop_coordinator=form_data.proposed_workshop_coordinator).exists():
+ return redirect('/my_workshops/')
+ else:
+ form_data.proposed_workshop_coordinator.save()
+ form_data.save()
+ return redirect('/my_workshops/')
else:
form = ProposeWorkshopDateForm()
return render(