Added new auth class (#23018)

* Added new auth class

- Created new class called OAuth2AuthenticationAllowInactiveUser, which replaces old class with same name
- Renames previous  OAuth2AuthenticationAllowInactiveUser to  OAuth2AuthenticationAllowInactiveUserDeprecated
- Replaced all imports of  OAuth2AuthenticationAllowInactiveUser to call deprecated class instead
- testing new class in discussion(added flag based on django setting)
This commit is contained in:
Manjinder Singh
2020-02-06 10:37:27 -05:00
committed by GitHub
parent b1d5ad8dcb
commit cea795b02e
22 changed files with 136 additions and 74 deletions

View File

@@ -23,7 +23,7 @@ from openedx.core.djangoapps.embargo import api as embargo_api
from openedx.core.djangoapps.enrollments.api import add_enrollment
from openedx.core.djangoapps.enrollments.views import EnrollmentCrossDomainSessionAuth
from openedx.core.djangoapps.user_api.preferences.api import update_email_opt_in
from openedx.core.lib.api.authentication import OAuth2AuthenticationAllowInactiveUser
from openedx.core.lib.api.authentication import OAuth2AuthenticationAllowInactiveUserDeprecated
from student.models import CourseEnrollment
from student.signals import SAILTHRU_AUDIT_PURCHASE
from util.json_request import JsonResponse
@@ -40,7 +40,7 @@ class BasketsView(APIView):
# LMS utilizes User.user_is_active to indicate email verification, not whether an account is active. Sigh!
authentication_classes = (JwtAuthentication,
OAuth2AuthenticationAllowInactiveUser,
OAuth2AuthenticationAllowInactiveUserDeprecated,
EnrollmentCrossDomainSessionAuth)
permission_classes = (IsAuthenticated,)