diff --git a/backend/Platform/urls.py b/backend/Platform/urls.py index dcfabda..6dbbff8 100644 --- a/backend/Platform/urls.py +++ b/backend/Platform/urls.py @@ -9,8 +9,7 @@ urlpatterns = [ path("admin/", admin.site.urls), - path("announcements/", include("announcements.urls", - namespace="announcements")), + path("announcements/", include("announcements.urls", namespace="announcements")), path("accounts/", include("accounts.urls", namespace="oauth2_provider")), path("options/", include("options.urls", namespace="options")), path("identity/", include("identity.urls", namespace="identity")), @@ -23,8 +22,7 @@ path( "documentation/", TemplateView.as_view( - template_name="redoc.html", - extra_context={"schema_url": "openapi-schema"} + template_name="redoc.html", extra_context={"schema_url": "openapi-schema"} ), name="documentation", ), @@ -35,6 +33,5 @@ urlpatterns = [ path("__debug__/", include(debug_toolbar.urls)), - path("emailpreview/", include("email_tools.urls", - namespace="email_tools")), + path("emailpreview/", include("email_tools.urls", namespace="email_tools")), ] + urlpatterns diff --git a/backend/accounts/oauth2_validator.py b/backend/accounts/oauth2_validator.py index 99e1f60..6e12585 100644 --- a/backend/accounts/oauth2_validator.py +++ b/backend/accounts/oauth2_validator.py @@ -3,16 +3,19 @@ class LabsOAuth2Validator(OAuth2Validator): oidc_claim_scope = OAuth2Validator.oidc_claim_scope - oidc_claim_scope.update({"name": "read", - "email": "read", - "pennid": "read", - "is_staff": "read", - "is_active": "read"}) + oidc_claim_scope.update( + { + "name": "read", + "email": "read", + "pennid": "read", + "is_staff": "read", + "is_active": "read", + } + ) def get_additional_claims(self, request): return { - "name": request.user.preferred_name or - request.user.get_full_name(), + "name": request.user.preferred_name or request.user.get_full_name(), "email": request.user.email, "pennid": request.user.pennid, "is_staff": request.user.is_staff, diff --git a/backend/accounts/urls.py b/backend/accounts/urls.py index 1a7e837..e04c2af 100644 --- a/backend/accounts/urls.py +++ b/backend/accounts/urls.py @@ -52,11 +52,12 @@ path("privacy/", PrivacySettingView.as_view(), name="privacy"), path("privacy//", PrivacySettingView.as_view(), name="privacy"), path("user/", FindUserView.as_view(), name="user"), - path(".well-known/openid-configuration", - ConnectDiscoveryInfoView.as_view(), - name="oidc-connect-discovery-info"), - path(".well-known/jwks.json", JwksInfoView.as_view(), - name="oidc-jwks-info"), + path( + ".well-known/openid-configuration", + ConnectDiscoveryInfoView.as_view(), + name="oidc-connect-discovery-info", + ), + path(".well-known/jwks.json", JwksInfoView.as_view(), name="oidc-jwks-info"), ] urlpatterns += router.urls diff --git a/backend/accounts/views.py b/backend/accounts/views.py index db1eebe..50f8acd 100644 --- a/backend/accounts/views.py +++ b/backend/accounts/views.py @@ -148,8 +148,7 @@ def post(self, request): "affiliation": affiliations, } user = auth.authenticate( - remote_user=user.pennid, - shibboleth_attributes=shibboleth_attributes + remote_user=user.pennid, shibboleth_attributes=shibboleth_attributes ) auth.login(request, user) return redirect(request.GET.get("next", "/accounts/me/"))