names: Make all apps use new api to retrieve domain names

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2019-08-11 18:39:54 -04:00
1 parent ab42b9b241
commit b684b07d11
10 files changed
+28 -55

No files matched your search

+4 -2
View File
@@ -30,7 +30,6 @@ from django.utils.translation import get_language_info
from django.utils.translation import ugettext_lazy as _
import plinth
from plinth import utils
class AppForm(forms.Form):
@@ -46,7 +45,10 @@ class DomainSelectionForm(forms.Form):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields['domain_name'].choices = utils.get_domain_names()
from plinth.modules.names.components import DomainName
domains = list(DomainName.list_names())
self.fields['domain_name'].choices = zip(domains, domains)
domain_name = forms.ChoiceField(
label=_('Select a domain name to be used with this application'),