from __future__ import unicode_literals

from django.db import migrations
from oauth2_provider.models import Application


class Migration(migrations.Migration):
    def add_default_application(apps, schema_editor):
        Application.objects.create(
            name="OSM Export Tool UI",
            redirect_uris="http://localhost/authorized",
            client_type=Application.CLIENT_PUBLIC,
            authorization_grant_type=Application.GRANT_IMPLICIT,
            skip_authorization=True)

    dependencies = [
        ("oauth2_provider", "0005_auto_20170514_1141"),
    ]

    operations = [
        migrations.RunPython(add_default_application),
    ]

from __future__ import unicode_literals

from django.db import migrations
from oauth2_provider.models import Application


class Migration(migrations.Migration):
    def add_default_application(apps, schema_editor):
        Application.objects.create(
            name="OSM Export Tool UI",
            redirect_uris=
            "http://localhost/authorized http://localhost:8080/authorized",
            client_type=Application.CLIENT_PUBLIC,
            authorization_grant_type=Application.GRANT_IMPLICIT,
            skip_authorization=True)

    dependencies = [
        ("oauth2_provider", "0005_auto_20170514_1141"),
    ]

    operations = [
        migrations.RunPython(add_default_application),
    ]

Include webpack-dev-server URL as a valid redirect
Include webpack-dev-server URL as a valid redirect

  from __future__ import unicode_literals
  
  from django.db import migrations
  from oauth2_provider.models import Application
  
  
  class Migration(migrations.Migration):
      def add_default_application(apps, schema_editor):
          Application.objects.create(
              name="OSM Export Tool UI",
-             redirect_uris="http://localhost/authorized",
+             redirect_uris=
+             "http://localhost/authorized http://localhost:8080/authorized",
              client_type=Application.CLIENT_PUBLIC,
              authorization_grant_type=Application.GRANT_IMPLICIT,
              skip_authorization=True)
  
      dependencies = [
          ("oauth2_provider", "0005_auto_20170514_1141"),
      ]
  
      operations = [
          migrations.RunPython(add_default_application),
      ]
  
Include webpack-dev-server URL as a valid redirect
## Code Before:
from __future__ import unicode_literals

from django.db import migrations
from oauth2_provider.models import Application


class Migration(migrations.Migration):
    def add_default_application(apps, schema_editor):
        Application.objects.create(
            name="OSM Export Tool UI",
            redirect_uris="http://localhost/authorized",
            client_type=Application.CLIENT_PUBLIC,
            authorization_grant_type=Application.GRANT_IMPLICIT,
            skip_authorization=True)

    dependencies = [
        ("oauth2_provider", "0005_auto_20170514_1141"),
    ]

    operations = [
        migrations.RunPython(add_default_application),
    ]

## Instruction:
Include webpack-dev-server URL as a valid redirect
## Code After:
from __future__ import unicode_literals

from django.db import migrations
from oauth2_provider.models import Application


class Migration(migrations.Migration):
    def add_default_application(apps, schema_editor):
        Application.objects.create(
            name="OSM Export Tool UI",
            redirect_uris=
            "http://localhost/authorized http://localhost:8080/authorized",
            client_type=Application.CLIENT_PUBLIC,
            authorization_grant_type=Application.GRANT_IMPLICIT,
            skip_authorization=True)

    dependencies = [
        ("oauth2_provider", "0005_auto_20170514_1141"),
    ]

    operations = [
        migrations.RunPython(add_default_application),
    ]
