Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mittal-ishaan committed Sep 22, 2023
2 parents 1d1d3f3 + 61692a1 commit c6d6abf
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions home/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def home(request):
"""
Display the Home Page :model:`home.models.home`.
**Template:**
*Template:*
:template:`home/home.html`
Expand All @@ -52,7 +52,7 @@ def rules(request):
"""
Display the Rules Page :model:`home.models.rules`.
**Template:**
*Template:*
:template:`home/rules.html`
Expand All @@ -71,7 +71,7 @@ def caterer(request, name):
"""
Display the Caterer Page :model:`home.models.caterer`.
**Template:**
*Template:*
:template:`home/caterer.html`
Expand All @@ -85,7 +85,7 @@ def links(request):
"""
Display the Forms Page :model:`home.models.links`.
**Template:**
*Template:*
:template:`home/links.html`
Expand All @@ -99,7 +99,7 @@ def cafeteria(request):
"""
Display the Cafeteria Page :model:`home.models.cafeteria`.
**Template:**
*Template:*
:template:`home/cafeteria.html`
Expand All @@ -113,7 +113,7 @@ def contact(request):
"""
Display the Contact Page :model:`home.models.contacts`.
**Template:**
*Template:*
:template:`home/contact.html`
Expand All @@ -132,7 +132,7 @@ def rebate(request):
adds the rebte to the rebate model and rebate bills of that semester.
This form can only be accessed by the Institute community
**Template:**
*Template:*
:template:`rebateForm.html`
"""
Expand Down Expand Up @@ -239,7 +239,7 @@ def allocation(request):
"""
Display the Rebate Form Page :model:`home.models.students`.
**Template:**
*Template:*
:template:`home/allocation.html`
Expand Down Expand Up @@ -363,7 +363,7 @@ def addLongRebateBill(request):
"""
Display the Rebate Form Page :model:`home.models.students`.
**Template:**
*Template:*
:template:`home/longRebate.html`
Expand Down Expand Up @@ -411,7 +411,7 @@ def allocationForm(request):
"""
Display the Allocation Form Page :model:`home.models.students`.
**Template:**
*Template:*
:template:`home/allocationForm.html`
Expand All @@ -424,7 +424,7 @@ def allocationForm(request):
key=student.email
text = ""
message = ""
if alloc_form.start_time and alloc_form.start_time>now() and alloc_form.end_time and alloc_form.end_time<now():
if (alloc_form.start_time and alloc_form.start_time > now()) or (alloc_form.end_time and alloc_form.end_time < now()):
message = "Form is closed for now."
elif Allocation.objects.filter(email=student,period=alloc_form.period).exists():
allocation_id = Allocation.objects.filter(email=student,period=alloc_form.period).last()
Expand Down Expand Up @@ -498,6 +498,7 @@ def allocationForm(request):
except Exception as e:
print(e)
message = "Signed in account can not fill the allocation form"
text = ""
context = {"text": text, "caterer_list": caterer_list, "allocation_form_details": alloc_form,"message":message}
return render(request, "allocationForm.html", context)

Expand All @@ -506,7 +507,7 @@ def profile(request):
"""
Display the Profile Page :model:`home.models.students`.
**Template:**
*Template:*
:template:`home/profile.html`
"""
Expand Down

0 comments on commit c6d6abf

Please sign in to comment.