From 0be1ca7876d8c8e20937bbdd3bf0ece68b5ef367 Mon Sep 17 00:00:00 2001 From: arbisoft Date: Wed, 10 Jul 2019 14:45:42 +0500 Subject: [PATCH] Fixing python-modernize issues. --- openedx/core/djangoapps/user_authn/apps.py | 4 +++- openedx/core/djangoapps/user_authn/cookies.py | 5 ++--- openedx/core/djangoapps/user_authn/exceptions.py | 2 ++ openedx/core/djangoapps/user_authn/urls_common.py | 5 +++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/openedx/core/djangoapps/user_authn/apps.py b/openedx/core/djangoapps/user_authn/apps.py index 128225801a..9e01559dfd 100644 --- a/openedx/core/djangoapps/user_authn/apps.py +++ b/openedx/core/djangoapps/user_authn/apps.py @@ -2,9 +2,11 @@ User Authentication Configuration """ +from __future__ import absolute_import + from django.apps import AppConfig -from openedx.core.djangoapps.plugins.constants import ProjectType, PluginURLs +from openedx.core.djangoapps.plugins.constants import PluginURLs, ProjectType class UserAuthnConfig(AppConfig): diff --git a/openedx/core/djangoapps/user_authn/cookies.py b/openedx/core/djangoapps/user_authn/cookies.py index 8fec6cb633..5c310dabf0 100644 --- a/openedx/core/djangoapps/user_authn/cookies.py +++ b/openedx/core/djangoapps/user_authn/cookies.py @@ -1,7 +1,7 @@ """ Utility functions for setting "logged in" cookies used by subdomains. """ -from __future__ import unicode_literals +from __future__ import absolute_import, unicode_literals import json import logging @@ -13,10 +13,10 @@ from django.contrib.auth.models import User from django.dispatch import Signal from django.urls import NoReverseMatch, reverse from django.utils.http import cookie_date - from edx_rest_framework_extensions.auth.jwt import cookies as jwt_cookies from edx_rest_framework_extensions.auth.jwt.constants import JWT_DELIMITER from oauth2_provider.models import Application + from openedx.core.djangoapps.oauth_dispatch.adapters import DOTAdapter from openedx.core.djangoapps.oauth_dispatch.api import create_dot_access_token from openedx.core.djangoapps.oauth_dispatch.jwt import create_jwt_from_token @@ -24,7 +24,6 @@ from openedx.core.djangoapps.user_api.accounts.utils import retrieve_last_sitewi from openedx.core.djangoapps.user_authn.exceptions import AuthFailedError from student.models import CourseEnrollment - log = logging.getLogger(__name__) diff --git a/openedx/core/djangoapps/user_authn/exceptions.py b/openedx/core/djangoapps/user_authn/exceptions.py index 7df072b69f..d79b0094ad 100644 --- a/openedx/core/djangoapps/user_authn/exceptions.py +++ b/openedx/core/djangoapps/user_authn/exceptions.py @@ -1,5 +1,7 @@ """ User Authn related Exceptions. """ +from __future__ import absolute_import + from openedx.core.djangolib.markup import Text diff --git a/openedx/core/djangoapps/user_authn/urls_common.py b/openedx/core/djangoapps/user_authn/urls_common.py index 1ba79798d0..b20698e8b0 100644 --- a/openedx/core/djangoapps/user_authn/urls_common.py +++ b/openedx/core/djangoapps/user_authn/urls_common.py @@ -6,11 +6,12 @@ For now, this is needed because of difference in CMS and LMS that have not yet been cleaned up. """ +from __future__ import absolute_import + from django.conf import settings from django.conf.urls import url -from .views import auto_auth, login, logout, deprecated - +from .views import auto_auth, deprecated, login, logout urlpatterns = [ url(r'^create_account$', deprecated.create_account, name='create_account'),