outposts: fix selection of outpost's service connection not showing name

This commit is contained in:
Jens Langhammer 2020-11-11 14:34:43 +01:00
parent e9a33ed8ab
commit c5eff4bdd6
1 changed files with 4 additions and 0 deletions

View File

@ -8,6 +8,7 @@ from passbook.outposts.models import (
DockerServiceConnection, DockerServiceConnection,
KubernetesServiceConnection, KubernetesServiceConnection,
Outpost, Outpost,
OutpostServiceConnection,
) )
from passbook.providers.proxy.models import ProxyProvider from passbook.providers.proxy.models import ProxyProvider
@ -18,6 +19,9 @@ class OutpostForm(forms.ModelForm):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs) super().__init__(*args, **kwargs)
self.fields["providers"].queryset = ProxyProvider.objects.all() self.fields["providers"].queryset = ProxyProvider.objects.all()
self.fields[
"service_connection"
].queryset = OutpostServiceConnection.objects.select_subclasses()
class Meta: class Meta: