fix errorenous logic when running a microsite that could reside in a hosting environment with a marketing site in front of it pep8/pylint fixes address PR feedback, remove underscore from test hostname more pep8/pylint cleanup. Skip test_microsites test, it works on localdev, not on Jenkins. Need to talk with QA team manually add Ned's single-to-double quote fix change aws.py runtimes so that the microsite_dir that is read from configuration is changed to a python path Conflicts: lms/templates/help_modal.html
50 lines
1.3 KiB
Python
50 lines
1.3 KiB
Python
"""
|
|
Public views
|
|
"""
|
|
from django_future.csrf import ensure_csrf_cookie
|
|
from django.core.context_processors import csrf
|
|
from django.shortcuts import redirect
|
|
from django.conf import settings
|
|
|
|
from edxmako.shortcuts import render_to_response
|
|
|
|
from external_auth.views import ssl_login_shortcut
|
|
|
|
from microsite_configuration.middleware import MicrositeConfiguration
|
|
|
|
__all__ = ['signup', 'login_page', 'howitworks']
|
|
|
|
|
|
@ensure_csrf_cookie
|
|
def signup(request):
|
|
"""
|
|
Display the signup form.
|
|
"""
|
|
csrf_token = csrf(request)['csrf_token']
|
|
return render_to_response('signup.html', {'csrf': csrf_token})
|
|
|
|
|
|
@ssl_login_shortcut
|
|
@ensure_csrf_cookie
|
|
def login_page(request):
|
|
"""
|
|
Display the login form.
|
|
"""
|
|
csrf_token = csrf(request)['csrf_token']
|
|
return render_to_response(
|
|
'login.html',
|
|
{
|
|
'csrf': csrf_token,
|
|
'forgot_password_link': "//{base}/login#forgot-password-modal".format(base=settings.LMS_BASE),
|
|
'platform_name': MicrositeConfiguration.get_microsite_configuration_value('platform_name', settings.PLATFORM_NAME),
|
|
}
|
|
)
|
|
|
|
|
|
def howitworks(request):
|
|
"Proxy view"
|
|
if request.user.is_authenticated():
|
|
return redirect('/course')
|
|
else:
|
|
return render_to_response('howitworks.html', {})
|