diff --git a/lms/envs/common.py b/lms/envs/common.py index 2946023bd082..aaaac94e6184 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -517,7 +517,7 @@ } # This is required for the migrations in oauth_dispatch.models # otherwise it fails saying this attribute is not present in Settings -OAUTH2_PROVIDER_APPLICATION_MODEL = 'oauth2_provider.Application' +OAUTH2_PROVIDER_APPLICATION_MODEL = 'oauth_dispatch.ScopedApplication' ################################## TEMPLATE CONFIGURATION ##################################### # Mako templating diff --git a/openedx/core/djangoapps/oauth_dispatch/admin.py b/openedx/core/djangoapps/oauth_dispatch/admin.py index 2c01b289d15c..b6155391a825 100644 --- a/openedx/core/djangoapps/oauth_dispatch/admin.py +++ b/openedx/core/djangoapps/oauth_dispatch/admin.py @@ -5,7 +5,7 @@ from django.contrib.admin import ModelAdmin, site from oauth2_provider import models -from .models import RestrictedApplication +from .models import RestrictedApplication, ScopedApplication def reregister(model_class): @@ -52,13 +52,13 @@ class DOTRefreshTokenAdmin(ModelAdmin): search_fields = [u'token', u'user__username', u'access_token__token'] -@reregister(models.Application) -class DOTApplicationAdmin(ModelAdmin): +@reregister(ScopedApplication) +class ScopedApplicationAdmin(ModelAdmin): """ Custom Application Admin """ list_display = [u'name', u'user', u'client_type', u'authorization_grant_type', u'client_id'] - list_filter = [u'client_type', u'authorization_grant_type'] + list_filter = [u'client_type', u'authorization_grant_type', u'skip_authorization'] raw_id_fields = [u'user'] search_fields = [u'name', u'user__username', u'client_id'] diff --git a/openedx/core/djangoapps/oauth_dispatch/models.py b/openedx/core/djangoapps/oauth_dispatch/models.py index 0faeb1f0f8a2..26f677b8b2bd 100644 --- a/openedx/core/djangoapps/oauth_dispatch/models.py +++ b/openedx/core/djangoapps/oauth_dispatch/models.py @@ -75,9 +75,7 @@ def __unicode__(self): """ Return a unicode representation of this object. """ - return u"".format( - name=self.name - ) + return self.name @property def authorization_filters(self):