*: Adjust forms to only show respective types of Flows and PropertyMappings

This commit is contained in:
Jens Langhammer
2020-08-01 20:00:20 +02:00
parent fcf70a3cd4
commit d4a5269bf1
6 changed files with 41 additions and 28 deletions

View File

@ -10,9 +10,11 @@ from passbook.providers.oauth.models import OAuth2Provider
class OAuth2ProviderForm(forms.ModelForm):
"""OAuth2 Provider form"""
authorization_flow = forms.ModelChoiceField(
queryset=Flow.objects.filter(designation=FlowDesignation.AUTHORIZATION)
)
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields["authorization_flow"].queryset = Flow.objects.filter(
designation=FlowDesignation.AUTHORIZATION
)
class Meta: