Skip to content

Commit

Permalink
Merge migrations and sort imports isort for flake8 lint check
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkwelltwd committed Sep 3, 2020
1 parent c93d677 commit 1e8d66b
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 58 deletions.
21 changes: 0 additions & 21 deletions oauth2_provider/migrations/0003_auto_20190413_2007.py

This file was deleted.

Expand Up @@ -9,10 +9,20 @@ class Migration(migrations.Migration):

dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('oauth2_provider', '0003_auto_20190413_2007'),
('oauth2_provider', '0002_auto_20190406_1805'),
]

operations = [
migrations.AddField(
model_name='application',
name='algorithm',
field=models.CharField(choices=[('RS256', 'RSA with SHA-2 256'), ('HS256', 'HMAC with SHA-2 256')], default='RS256', max_length=5),
),
migrations.AlterField(
model_name='application',
name='authorization_grant_type',
field=models.CharField(choices=[('authorization-code', 'Authorization code'), ('implicit', 'Implicit'), ('password', 'Resource owner password-based'), ('client-credentials', 'Client credentials'), ('openid-hybrid', 'OpenID connect hybrid')], max_length=32),
),
migrations.CreateModel(
name='IDToken',
fields=[
Expand All @@ -30,4 +40,9 @@ class Migration(migrations.Migration):
'swappable': 'OAUTH2_PROVIDER_ID_TOKEN_MODEL',
},
),
migrations.AddField(
model_name='accesstoken',
name='id_token',
field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='access_token', to=oauth2_settings.ID_TOKEN_MODEL),
),
]
20 changes: 0 additions & 20 deletions oauth2_provider/migrations/0005_accesstoken_id_token.py

This file was deleted.

8 changes: 2 additions & 6 deletions oauth2_provider/oauth2_validators.py
Expand Up @@ -27,12 +27,8 @@

from .exceptions import FatalClientError
from .models import (
AbstractApplication,
get_access_token_model,
get_id_token_model,
get_application_model,
get_grant_model,
get_refresh_token_model,
AbstractApplication, get_access_token_model, get_application_model,
get_grant_model, get_id_token_model, get_refresh_token_model
)
from .scopes import get_scopes_backend
from .settings import oauth2_settings
Expand Down
2 changes: 1 addition & 1 deletion oauth2_provider/urls.py
Expand Up @@ -29,7 +29,7 @@

oidc_urlpatterns = [
re_path(r"^\.well-known/openid-configuration/$", views.ConnectDiscoveryInfoView.as_view(),
name="oidc-connect-discovery-info"),
name="oidc-connect-discovery-info"),
re_path(r"^jwks/$", views.JwksInfoView.as_view(), name="jwks-info"),
re_path(r"^userinfo/$", views.UserInfoView.as_view(), name="user-info")
]
Expand Down
6 changes: 2 additions & 4 deletions tests/test_authorization_code.py
Expand Up @@ -13,10 +13,8 @@
from oauthlib.oauth2.rfc6749 import errors as oauthlib_errors

from oauth2_provider.models import (
get_access_token_model,
get_application_model,
get_grant_model,
get_refresh_token_model,
get_access_token_model, get_application_model,
get_grant_model, get_refresh_token_model
)
from oauth2_provider.settings import oauth2_settings
from oauth2_provider.views import ProtectedResourceView
Expand Down
4 changes: 1 addition & 3 deletions tests/test_implicit.py
@@ -1,11 +1,9 @@
from urllib.parse import parse_qs, urlparse

import json
from urllib.parse import parse_qs, urlparse

from django.contrib.auth import get_user_model
from django.test import RequestFactory, TestCase
from django.urls import reverse

from jwcrypto import jwk, jwt

from oauth2_provider.models import get_application_model
Expand Down
2 changes: 1 addition & 1 deletion tests/urls.py
@@ -1,5 +1,5 @@
from django.urls import include, re_path
from django.contrib import admin
from django.urls import include, re_path


admin.autodiscover()
Expand Down
1 change: 0 additions & 1 deletion tox.ini
Expand Up @@ -35,7 +35,6 @@ deps =
pytest-xdist
py27: mock
requests
jwcrypto

[testenv:py37-docs]
basepython = python
Expand Down

0 comments on commit 1e8d66b

Please sign in to comment.