adding login views
This commit is contained in:
@@ -203,6 +203,22 @@ def _cert_info(user, course, cert_status):
|
||||
|
||||
return d
|
||||
|
||||
|
||||
def login(request):
|
||||
"""
|
||||
This view will display the non-modal login form
|
||||
"""
|
||||
context = {}
|
||||
return render_to_response('login.html', context)
|
||||
|
||||
def register(request):
|
||||
"""
|
||||
This view will display the non-modal registration form
|
||||
"""
|
||||
context = {}
|
||||
return render_to_response('register.html', context)
|
||||
|
||||
|
||||
@login_required
|
||||
@ensure_csrf_cookie
|
||||
def dashboard(request):
|
||||
@@ -675,18 +691,11 @@ def create_exam_registration(request, post_override=None):
|
||||
username = post_vars['username']
|
||||
user = User.objects.get(username=username)
|
||||
course_id = post_vars['course_id']
|
||||
course = course_from_id(course_id) # assume it will be found....
|
||||
|
||||
# make sure that any demographic data values received from the page have been stripped.
|
||||
# Whitespace is not an acceptable response for any of these values
|
||||
demographic_data = {}
|
||||
for fieldname in TestCenterUser.user_provided_fields():
|
||||
if fieldname in post_vars:
|
||||
demographic_data[fieldname] = (post_vars[fieldname]).strip()
|
||||
course = (course_from_id(course_id)) # assume it will be found....
|
||||
|
||||
try:
|
||||
testcenter_user = TestCenterUser.objects.get(user=user)
|
||||
needs_updating = testcenter_user.needs_update(demographic_data)
|
||||
needs_updating = testcenter_user.needs_update(post_vars)
|
||||
log.info("User {0} enrolled in course {1} {2}updating demographic info for exam registration".format(user.username, course_id, "" if needs_updating else "not "))
|
||||
except TestCenterUser.DoesNotExist:
|
||||
# do additional initialization here:
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
<%inherit file="main.html" />
|
||||
|
||||
<%namespace name='static' file='static_content.html'/>
|
||||
<%block name="title"><title>login</title></%block>
|
||||
|
||||
<%block name="title"><title>Login</title></%block>
|
||||
|
||||
|
||||
|
||||
<section class="container login">
|
||||
</section>
|
||||
Hello world
|
||||
|
||||
7
lms/templates/register.html
Normal file
7
lms/templates/register.html
Normal file
@@ -0,0 +1,7 @@
|
||||
<%inherit file="main.html" />
|
||||
|
||||
<%namespace name='static' file='static_content.html'/>
|
||||
<%block name="title"><title>register</title></%block>
|
||||
|
||||
Hello world
|
||||
|
||||
@@ -15,6 +15,8 @@ urlpatterns = ('',
|
||||
url(r'^update_certificate$', 'certificates.views.update_certificate'),
|
||||
url(r'^$', 'branding.views.index', name="root"), # Main marketing page, or redirect to courseware
|
||||
url(r'^dashboard$', 'student.views.dashboard', name="dashboard"),
|
||||
url(r'^login$', 'student.views.login', name="login"),
|
||||
url(r'^register$', 'student.views.register', name="register"),
|
||||
|
||||
url(r'^admin_dashboard$', 'dashboard.views.dashboard'),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user