checking django-wiki and fixing deprecation warnings.
This commit is contained in:
Awais Qureshi
2020-03-12 10:42:59 +05:00
parent f692739da3
commit 0f002bafb8
20 changed files with 32 additions and 30 deletions

View File

@@ -4,8 +4,7 @@ Context dictionary for templates that use the ace_common base template.
from django.conf import settings
from django.core.urlresolvers import NoReverseMatch
from django.urls import reverse
from django.urls import NoReverseMatch, reverse
from edxmako.shortcuts import marketing_link
from openedx.core.djangoapps.theming.helpers import get_config_value_from_site_or_settings

View File

@@ -4,7 +4,7 @@ Classes that override default django-oauth-toolkit behavior
from oauth2_provider.exceptions import OAuthToolkitError
from oauth2_provider.http import HttpResponseUriRedirect
from oauth2_provider.http import OAuth2ResponseRedirect
from oauth2_provider.models import get_access_token_model, get_application_model
from oauth2_provider.scopes import get_scopes_backend
from oauth2_provider.settings import oauth2_settings
@@ -72,7 +72,7 @@ class EdxOAuth2AuthorizationView(AuthorizationView):
uri, headers, body, status = self.create_authorization_response(
request=self.request, scopes=" ".join(scopes),
credentials=credentials, allow=True)
return HttpResponseUriRedirect(uri, application.get_allowed_schemes())
return OAuth2ResponseRedirect(uri, application.get_allowed_schemes())
# *** Changed the if statement that checked for require_approval to an assert.
assert require_approval == 'auto_even_if_expired'
@@ -90,7 +90,7 @@ class EdxOAuth2AuthorizationView(AuthorizationView):
uri, headers, body, status = self.create_authorization_response(
request=self.request, scopes=" ".join(scopes),
credentials=credentials, allow=True)
return HttpResponseUriRedirect(uri, application.get_allowed_schemes())
return OAuth2ResponseRedirect(uri, application.get_allowed_schemes())
# render an authorization prompt so the user can approve
# the application's requested scopes

View File

@@ -18,8 +18,8 @@ from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.core import mail
from django.core.cache import cache
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.urls import reverse
from enterprise.models import (
EnterpriseCourseEnrollment,
EnterpriseCustomer,

View File

@@ -14,9 +14,9 @@ import mock
import pytz
import six
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test.testcases import TransactionTestCase
from django.test.utils import override_settings
from django.urls import reverse
from rest_framework.test import APIClient, APITestCase
from six.moves import range

View File

@@ -6,9 +6,9 @@ Django admin configuration pages for the user_api app
from django.conf.urls import url
from django.contrib import admin, messages
from django.core.exceptions import ValidationError
from django.core.urlresolvers import reverse
from django.http import HttpResponseForbidden, HttpResponseRedirect
from django.template.response import TemplateResponse
from django.urls import reverse
from django.utils.html import format_html
from django.utils.translation import ugettext as _