Commit 835cc087 by Clinton Blackburn Committed by Clinton Blackburn

Removed usage of LogoutViewConfiguration

This model will soon be deleted.

LEARNER-2042
parent 2d0fc911
...@@ -15,7 +15,6 @@ from student.models import ( ...@@ -15,7 +15,6 @@ from student.models import (
CourseEnrollmentAllowed, CourseEnrollmentAllowed,
DashboardConfiguration, DashboardConfiguration,
LinkedInAddToProfileConfiguration, LinkedInAddToProfileConfiguration,
LogoutViewConfiguration,
PendingNameChange, PendingNameChange,
Registration, Registration,
RegistrationCookieConfiguration, RegistrationCookieConfiguration,
...@@ -203,7 +202,6 @@ admin.site.register(CourseEnrollmentAllowed) ...@@ -203,7 +202,6 @@ admin.site.register(CourseEnrollmentAllowed)
admin.site.register(Registration) admin.site.register(Registration)
admin.site.register(PendingNameChange) admin.site.register(PendingNameChange)
admin.site.register(DashboardConfiguration, ConfigurationModelAdmin) admin.site.register(DashboardConfiguration, ConfigurationModelAdmin)
admin.site.register(LogoutViewConfiguration, ConfigurationModelAdmin)
admin.site.register(RegistrationCookieConfiguration, ConfigurationModelAdmin) admin.site.register(RegistrationCookieConfiguration, ConfigurationModelAdmin)
......
...@@ -2469,7 +2469,7 @@ class UserAttribute(TimeStampedModel): ...@@ -2469,7 +2469,7 @@ class UserAttribute(TimeStampedModel):
class LogoutViewConfiguration(ConfigurationModel): class LogoutViewConfiguration(ConfigurationModel):
""" Configuration for the logout view. """ """ DEPRECATED: Configuration for the logout view. """
def __unicode__(self): def __unicode__(self):
"""Unicode representation of the instance. """ """Unicode representation of the instance. """
......
...@@ -18,7 +18,7 @@ from pyquery import PyQuery as pq ...@@ -18,7 +18,7 @@ from pyquery import PyQuery as pq
from student.cookies import get_user_info_cookie_data from student.cookies import get_user_info_cookie_data
from student.helpers import DISABLE_UNENROLL_CERT_STATES from student.helpers import DISABLE_UNENROLL_CERT_STATES
from student.models import CourseEnrollment, LogoutViewConfiguration, UserProfile from student.models import CourseEnrollment, UserProfile
from student.tests.factories import CourseEnrollmentFactory, UserFactory from student.tests.factories import CourseEnrollmentFactory, UserFactory
from xmodule.modulestore import ModuleStoreEnum from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
...@@ -126,7 +126,6 @@ class LogoutTests(TestCase): ...@@ -126,7 +126,6 @@ class LogoutTests(TestCase):
super(LogoutTests, self).setUp() super(LogoutTests, self).setUp()
self.user = UserFactory() self.user = UserFactory()
self.client.login(username=self.user.username, password=PASSWORD) self.client.login(username=self.user.username, password=PASSWORD)
LogoutViewConfiguration.objects.create(enabled=True)
def create_oauth_client(self): def create_oauth_client(self):
""" Creates a trusted OAuth client. """ """ Creates a trusted OAuth client. """
...@@ -171,20 +170,6 @@ class LogoutTests(TestCase): ...@@ -171,20 +170,6 @@ class LogoutTests(TestCase):
response = self.client.get(url) response = self.client.get(url)
self.assertRedirects(response, '/courses', fetch_redirect_response=False) self.assertRedirects(response, '/courses', fetch_redirect_response=False)
def test_switch_default(self):
""" Verify the IDA logout functionality is disabled if the associated switch is disabled. """
LogoutViewConfiguration.objects.create(enabled=False)
oauth_client = self.create_oauth_client()
self.authenticate_with_oauth(oauth_client)
self.assert_logout_redirects_to_root()
def test_switch_with_redirect_url(self):
""" Verify the IDA logout functionality is disabled if the associated switch is disabled. """
LogoutViewConfiguration.objects.create(enabled=False)
oauth_client = self.create_oauth_client()
self.authenticate_with_oauth(oauth_client)
self.assert_logout_redirects_with_target()
def test_without_session_value(self): def test_without_session_value(self):
""" Verify logout works even if the session does not contain an entry with """ Verify logout works even if the session does not contain an entry with
the authenticated OpenID Connect clients.""" the authenticated OpenID Connect clients."""
......
...@@ -108,7 +108,6 @@ from student.models import ( ...@@ -108,7 +108,6 @@ from student.models import (
DashboardConfiguration, DashboardConfiguration,
LinkedInAddToProfileConfiguration, LinkedInAddToProfileConfiguration,
LoginFailures, LoginFailures,
LogoutViewConfiguration,
ManualEnrollmentAudit, ManualEnrollmentAudit,
PasswordHistory, PasswordHistory,
PendingEmailChange, PendingEmailChange,
...@@ -2871,7 +2870,7 @@ class LogoutView(TemplateView): ...@@ -2871,7 +2870,7 @@ class LogoutView(TemplateView):
logout(request) logout(request)
# If we don't need to deal with OIDC logouts, just redirect the user. # If we don't need to deal with OIDC logouts, just redirect the user.
if LogoutViewConfiguration.current().enabled and self.oauth_client_ids: if self.oauth_client_ids:
response = super(LogoutView, self).dispatch(request, *args, **kwargs) response = super(LogoutView, self).dispatch(request, *args, **kwargs)
else: else:
response = redirect(self.target) response = redirect(self.target)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment