Commit 673344aa authored by Benjamin S Waters's avatar Benjamin S Waters
Browse files

created custom login view need to integrate with cas

parent a9f5bffc
from django.http import Http404
from django.shortcuts import render_to_response
from django.contrib.auth import authenticate, login
def index(request):
return render_to_response('management/index.html')
def login(requets):
def login(request):
username = request.POST['username']
password = request.POST['password']
user = authenticate(username=username, password=password)
if user is not None:
if user.is_active and user.is_staff:
login(request,user)
return render_to_response('management/index.html')
else:
return render_to_response('403.html')
else:
return render_to_response('management/login.html')
......@@ -100,10 +100,10 @@ class OpenTime(TimeStampedModel):
thursday_end = models.TimeField()
friday_start = models.TimeField()
friday_end = models.TimeField()
saturday_start = models.TimeField()
saturday_end = models.TimeField()
sunday_start = models.TimeField()
sunday_end = models.TimeField()
saturday_start = models.TimeField(blank=True,null=True)
saturday_end = models.TimeField(blank=True,null=True)
sunday_start = models.TimeField(blank=True,null=True)
sunday_end = models.TimeField(blank=True,null=True)
def isOpenNow(self):
"""Return true if the current time is this OpenTime's range"""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment