diff --git a/openedx/core/djangoapps/oauth_dispatch/migrations/0005_applicationaccess_type.py b/openedx/core/djangoapps/oauth_dispatch/migrations/0005_applicationaccess_type.py new file mode 100644 index 0000000000000000000000000000000000000000..5692f63b5a9832e644f391c5eb5ef31bb2edbfc1 --- /dev/null +++ b/openedx/core/djangoapps/oauth_dispatch/migrations/0005_applicationaccess_type.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.13 on 2018-06-29 18:18 +from __future__ import unicode_literals + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('oauth_dispatch', '0004_auto_20180626_1349'), + ] + + operations = [ + migrations.AlterField( + model_name='applicationaccess', + name='application', + field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='access', to=settings.OAUTH2_PROVIDER_APPLICATION_MODEL), + ), + ] diff --git a/openedx/core/djangoapps/oauth_dispatch/models.py b/openedx/core/djangoapps/oauth_dispatch/models.py index 97e090cbcc957547d20e9d32fbfce7288610a17e..9ffff624627c08fcfec9adbddfa468246918b6fe 100644 --- a/openedx/core/djangoapps/oauth_dispatch/models.py +++ b/openedx/core/djangoapps/oauth_dispatch/models.py @@ -58,7 +58,7 @@ class ApplicationAccess(models.Model): Specifies access control information for the associated Application. """ - application = models.ForeignKey(oauth2_settings.APPLICATION_MODEL, unique=True, related_name='access') + application = models.OneToOneField(oauth2_settings.APPLICATION_MODEL, related_name='access') scopes = ListCharField( base_field=models.CharField(max_length=32), size=25,