diff --git a/common/djangoapps/third_party_auth/management/commands/tests/test_saml.py b/common/djangoapps/third_party_auth/management/commands/tests/test_saml.py index 66ffcd3d86..b9c76f470d 100644 --- a/common/djangoapps/third_party_auth/management/commands/tests/test_saml.py +++ b/common/djangoapps/third_party_auth/management/commands/tests/test_saml.py @@ -152,7 +152,6 @@ class TestSAMLCommand(TestCase): saml_provider_config={ "site__domain": "second.testserver.fake", "site__name": "testserver.fake", - "idp_slug": "second-test-shib", "slug": "second-test-shib", "entity_id": "https://idp.testshib.org/idp/another-shibboleth", "metadata_source": "https://www.testshib.org/metadata/another-testshib-providers.xml", @@ -168,7 +167,6 @@ class TestSAMLCommand(TestCase): saml_provider_config={ "site__domain": "third.testserver.fake", "site__name": "testserver.fake", - "idp_slug": "third-test-shib", "slug": "third-test-shib", # Note: This entity id will not be present in returned response and will cause failed update. "entity_id": "https://idp.testshib.org/idp/non-existent-shibboleth", @@ -190,7 +188,6 @@ class TestSAMLCommand(TestCase): saml_provider_config={ "site__domain": "fourth.testserver.fake", "site__name": "testserver.fake", - "idp_slug": "fourth-test-shib", "slug": "fourth-test-shib", "automatic_refresh_enabled": False, # Note: This invalid entity id will not be present in the refresh set @@ -245,7 +242,6 @@ class TestSAMLCommand(TestCase): }, saml_provider_config={ "site__domain": "third.testserver.fake", - "idp_slug": "third-test-shib", "slug": "third-test-shib", # Note: This entity id will not be present in returned response and will cause failed update. "entity_id": "https://idp.testshib.org/idp/non-existent-shibboleth", diff --git a/common/djangoapps/third_party_auth/migrations/0020_cleanup_slug_fields.py b/common/djangoapps/third_party_auth/migrations/0020_cleanup_slug_fields.py new file mode 100644 index 0000000000..05b4692d65 --- /dev/null +++ b/common/djangoapps/third_party_auth/migrations/0020_cleanup_slug_fields.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.12 on 2018-04-10 13:57 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('third_party_auth', '0019_consolidate_slug'), + ] + + operations = [ + migrations.RemoveField( + model_name='oauth2providerconfig', + name='provider_slug', + ), + migrations.RemoveField( + model_name='samlproviderconfig', + name='idp_slug', + ), + ] diff --git a/common/djangoapps/third_party_auth/models.py b/common/djangoapps/third_party_auth/models.py index 6c076ba82c..01867e5e11 100644 --- a/common/djangoapps/third_party_auth/models.py +++ b/common/djangoapps/third_party_auth/models.py @@ -328,12 +328,6 @@ class OAuth2ProviderConfig(ProviderConfig): # To be precise, it's set by AUTHENTICATION_BACKENDS - which aws.py sets from THIRD_PARTY_AUTH_BACKENDS ) ) - provider_slug = models.SlugField( - max_length=30, db_index=True, - help_text=( - 'A short string uniquely identifying this provider. ' - 'Cannot contain spaces and should be a usable as a CSS class. Examples: "ubc", "mit-staging"' - )) key = models.TextField(blank=True, verbose_name="Client ID") secret = models.TextField( blank=True, @@ -524,12 +518,6 @@ class SAMLProviderConfig(ProviderConfig): backend_name = models.CharField( max_length=50, default='tpa-saml', blank=False, help_text="Which python-social-auth provider backend to use. 'tpa-saml' is the standard edX SAML backend.") - idp_slug = models.SlugField( - max_length=30, db_index=True, - help_text=( - 'A short string uniquely identifying this provider. ' - 'Cannot contain spaces and should be a usable as a CSS class. Examples: "ubc", "mit-staging"' - )) entity_id = models.CharField( max_length=255, verbose_name="Entity ID", help_text="Example: https://idp.testshib.org/idp/shibboleth") metadata_source = models.CharField( diff --git a/common/djangoapps/third_party_auth/tests/factories.py b/common/djangoapps/third_party_auth/tests/factories.py index 682ef84ec3..b0fafd25a6 100644 --- a/common/djangoapps/third_party_auth/tests/factories.py +++ b/common/djangoapps/third_party_auth/tests/factories.py @@ -30,7 +30,6 @@ class SAMLProviderConfigFactory(DjangoModelFactory): site = SubFactory(SiteFactory) enabled = True - idp_slug = "test-shib" slug = "test-shib" name = "TestShib College" diff --git a/common/djangoapps/third_party_auth/tests/specs/test_testshib.py b/common/djangoapps/third_party_auth/tests/specs/test_testshib.py index 21712382fd..7478ab0a00 100644 --- a/common/djangoapps/third_party_auth/tests/specs/test_testshib.py +++ b/common/djangoapps/third_party_auth/tests/specs/test_testshib.py @@ -91,7 +91,6 @@ class SamlIntegrationTestUtilities(object): kwargs.setdefault('name', self.PROVIDER_NAME) kwargs.setdefault('enabled', True) kwargs.setdefault('visible', True) - kwargs.setdefault('idp_slug', self.PROVIDER_IDP_SLUG) kwargs.setdefault('slug', self.PROVIDER_IDP_SLUG) kwargs.setdefault('entity_id', TESTSHIB_ENTITY_ID) kwargs.setdefault('metadata_source', TESTSHIB_METADATA_URL) @@ -200,7 +199,6 @@ class TestShibIntegrationTest(SamlIntegrationTestUtilities, IntegrationTestMixin kwargs.setdefault('name', self.PROVIDER_NAME) kwargs.setdefault('enabled', True) kwargs.setdefault('visible', True) - kwargs.setdefault('idp_slug', self.PROVIDER_IDP_SLUG) kwargs.setdefault('slug', self.PROVIDER_IDP_SLUG) kwargs.setdefault('entity_id', TESTSHIB_ENTITY_ID) kwargs.setdefault('metadata_source', TESTSHIB_METADATA_URL_WITH_CACHE_DURATION) diff --git a/common/djangoapps/third_party_auth/tests/test_provider.py b/common/djangoapps/third_party_auth/tests/test_provider.py index f17f31f0d2..eddc08cb76 100644 --- a/common/djangoapps/third_party_auth/tests/test_provider.py +++ b/common/djangoapps/third_party_auth/tests/test_provider.py @@ -58,7 +58,6 @@ class RegistryTest(testutil.TestCase): self.configure_saml_provider( enabled=True, name="Disallowed", - idp_slug="test", slug="test", backend_name="disallowed" ) diff --git a/common/djangoapps/third_party_auth/tests/testutil.py b/common/djangoapps/third_party_auth/tests/testutil.py index fdbc99d575..6d963757a2 100644 --- a/common/djangoapps/third_party_auth/tests/testutil.py +++ b/common/djangoapps/third_party_auth/tests/testutil.py @@ -78,7 +78,6 @@ class ThirdPartyAuthTestMixin(object): @staticmethod def configure_oauth_provider(**kwargs): """ Update the settings for an OAuth2-based third party auth provider """ - kwargs.setdefault('provider_slug', kwargs['backend_name']) kwargs.setdefault('slug', kwargs['backend_name']) obj = OAuth2ProviderConfig(**kwargs) obj.save() diff --git a/common/test/db_fixtures/third_party_auth.json b/common/test/db_fixtures/third_party_auth.json index 2b8fe15bcc..abb233ac6b 100644 --- a/common/test/db_fixtures/third_party_auth.json +++ b/common/test/db_fixtures/third_party_auth.json @@ -10,7 +10,6 @@ "icon_class": "fa-google-plus", "icon_image": null, "backend_name": "google-oauth2", - "provider_slug": "google-oauth2", "slug": "google-oauth2", "key": "test", "secret": "test", @@ -30,7 +29,6 @@ "icon_class": "fa-facebook", "icon_image": null, "backend_name": "facebook", - "provider_slug": "facebook", "slug": "facebook", "key": "test", "secret": "test", @@ -50,7 +48,6 @@ "icon_class": "", "icon_image": "test-icon.png", "backend_name": "dummy", - "provider_slug": "dummy", "slug": "dummy", "key": "", "secret": "", diff --git a/lms/djangoapps/student_account/test/test_views.py b/lms/djangoapps/student_account/test/test_views.py index 116833252a..06afcd5246 100644 --- a/lms/djangoapps/student_account/test/test_views.py +++ b/lms/djangoapps/student_account/test/test_views.py @@ -499,7 +499,6 @@ class StudentAccountLoginAndRegistrationTest(ThirdPartyAuthTestMixin, UrlResetMi kwargs.setdefault('name', provider_name) kwargs.setdefault('enabled', True) kwargs.setdefault('visible', True) - kwargs.setdefault('idp_slug', idp_slug) kwargs.setdefault('slug', idp_slug) kwargs.setdefault('entity_id', 'https://idp.testshib.org/idp/shibboleth') kwargs.setdefault('metadata_source', 'https://mock.testshib.org/metadata/testshib-providers.xml')