Skip to content
Snippets Groups Projects
Verified Commit 88adac18 authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Set multiple select with scopes as choices for allowed_scopes field

parent 0d1ac60b
No related branches found
No related tags found
1 merge request!759Resolve "[OAuth] Allow limiting scopes per application"
......@@ -31,6 +31,7 @@ from .registries import (
person_preferences_registry,
site_preferences_registry,
)
from .util.auth_helpers import AppScopes
from .util.core_helpers import get_site_preferences
......@@ -594,6 +595,12 @@ class ListActionForm(ActionForm):
class OAuthApplicationForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields["allowed_scopes"].widget = forms.SelectMultiple(
choices=list(AppScopes().get_all_scopes().items())
)
class Meta:
model = OAuthApplication
fields = (
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment