diff options
author | Akshen | 2018-03-09 16:43:36 +0530 |
---|---|---|
committer | Akshen | 2018-03-09 16:43:36 +0530 |
commit | 5d4c699ea8d2fa7d7751b2998c49aceb1baa5d5e (patch) | |
tree | b0f17d3224c86b08eb97729f9223f9b4d4194ae1 /workshop_app/views.py | |
parent | fe854319dfb89d17107a13c48f044353d4247fad (diff) | |
download | workshop_booking-5d4c699ea8d2fa7d7751b2998c49aceb1baa5d5e.tar.gz workshop_booking-5d4c699ea8d2fa7d7751b2998c49aceb1baa5d5e.tar.bz2 workshop_booking-5d4c699ea8d2fa7d7751b2998c49aceb1baa5d5e.zip |
Add FOSSEE fellowship tag in registration form
- Adds FOSSEE fellowship to registration form
- Removes Register and Login tab from Self Workshop
- Removes 0 count coordinators from Profile Stats->Coordinator Statistics
- Removes previously taken workshop data from My Workshops tab for Instructors
- Adds email to reschedule workshop calender function
Diffstat (limited to 'workshop_app/views.py')
-rw-r--r-- | workshop_app/views.py | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/workshop_app/views.py b/workshop_app/views.py index c342c44..2e6a8fd 100644 --- a/workshop_app/views.py +++ b/workshop_app/views.py @@ -583,6 +583,8 @@ def my_workshops(request): workshop_date = datetime.strptime( client_data[3], "%Y-%m-%d" ) + + cemail = User.objects.get(id=cid) today = datetime.today() if today > new_workshop_date: return HttpResponse("Please Give proper Date!") @@ -603,6 +605,20 @@ def my_workshops(request): proposed_workshop_date=workshop_date).update( proposed_workshop_date=new_workshop_date) + #For Instructor + send_email(request, call_on='Change Date', + user_position='instructor', + workshop_date=workshop_date.date(), + new_workshop_date=str(new_workshop_date.date()) + ) + + #For Coordinator + send_email(request, call_on='Change Date', + new_workshop_date=str(new_workshop_date.date()), + workshop_date=str(workshop_date.date()), + other_email=cemail.email + ) + return HttpResponse("Date Changed") else: @@ -644,14 +660,17 @@ def my_workshops(request): ) workshops = [] + today = datetime.today().date() workshop_occurence_list = RequestedWorkshop.objects.filter( - requested_workshop_instructor=user.id + requested_workshop_instructor=user.id, + requested_workshop_date__gt=today, ).order_by('-requested_workshop_date') for w in workshop_occurence_list: workshops.append(w) proposed_workshop = ProposeWorkshopDate.objects.filter( - proposed_workshop_instructor=user.id + proposed_workshop_instructor=user.id, + proposed_workshop_date__gt=today, ).order_by('-proposed_workshop_date') for p in proposed_workshop: workshops.append(p) @@ -662,7 +681,6 @@ def my_workshops(request): for p in proposed_workshop_pending: workshops.append(p) - today = datetime.today().date() #Show upto 12 Workshops per page paginator = Paginator(workshops, 12) |