Merge pull request #18106 from edx/efischer/is_it_this_easy

Silence deprecation warnings
This commit is contained in:
Eric Fischer
2018-05-02 14:17:05 -04:00
committed by GitHub
81 changed files with 149 additions and 143 deletions

View File

@@ -35,7 +35,7 @@ class CourseImportExportViewMixin(DeveloperErrorViewMixin):
Ensures that the user is authenticated (e.g. not an AnonymousUser)
"""
super(CourseImportExportViewMixin, self).perform_authentication(request)
if request.user.is_anonymous():
if request.user.is_anonymous:
raise AuthenticationFailed

View File

@@ -24,7 +24,7 @@ def signup(request):
Display the signup form.
"""
csrf_token = csrf(request)['csrf_token']
if request.user.is_authenticated():
if request.user.is_authenticated:
return redirect('/course/')
if settings.FEATURES.get('AUTH_USE_CERTIFICATES_IMMEDIATE_SIGNUP'):
# Redirect to course to login to process their certificate if SSL is enabled
@@ -68,7 +68,7 @@ def login_page(request):
def howitworks(request):
"Proxy view"
if request.user.is_authenticated():
if request.user.is_authenticated:
return redirect('/home/')
else:
return render_to_response('howitworks.html', {})

View File

@@ -110,7 +110,7 @@ from openedx.core.release import RELEASE_LINE
</div>
</main>
% if user.is_authenticated():
% if user.is_authenticated:
<%include file="widgets/sock.html" args="online_help_token=online_help_token" />
% endif
<%include file="widgets/footer.html" />
@@ -142,7 +142,7 @@ from openedx.core.release import RELEASE_LINE
}
</script>
% endif
% if user.is_authenticated():
% if user.is_authenticated:
<%static:invoke_page_bundle page_name='js/sock'/>
% endif
<%block name='page_bundle'>

View File

@@ -190,7 +190,7 @@
<nav class="user-language-selector" aria-label="${_('Language preference')}">
<form action="/i18n/setlang/" method="post" class="settings-language-form" id="language-settings-form">
<input type="hidden" id="csrf_token" name="csrfmiddlewaretoken" value="${csrf_token}">
% if user.is_authenticated():
% if user.is_authenticated:
<input title="preference api" type="hidden" id="preference-api-url" class="url-endpoint" value="${reverse('preferences_api', kwargs={'username': user.username})}" data-user-is-authenticated="true">
% else:
<input title="session update url" type="hidden" id="update-session-url" class="url-endpoint" value="${reverse('session_language')}" data-user-is-authenticated="false">
@@ -210,7 +210,7 @@
</nav>
% endif
% endif
% if user.is_authenticated():
% if user.is_authenticated:
<nav class="nav-account nav-is-signedin nav-dd ui-right" aria-label="${_('Account')}">
<h2 class="sr-only">${_("Account Navigation")}</h2>
<ol>

View File

@@ -4,7 +4,7 @@
% if settings.CMS_SEGMENT_KEY:
<!-- begin segment footer -->
<script type="text/javascript">
% if user.is_authenticated():
% if user.is_authenticated:
// We can't use JQuery's on load method because it
// screws up RequireJS' JQuery initialization.
var onLoadCallback = function() {