mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
names: Sort domains by priority of their domain types
- First of the list is the most important one and may be used as "primary" domain in apps. - Change the return type of DomainName.list() from set to list so that order can be preserved. Update all users of the API accordingly. Add type hints to all the methods using this API to catch any errors. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
1 parent
045b336a9b
commit
aac12f4391
18 files changed
+73
-54
No files matched your search
@@ -7,14 +7,14 @@ import copy
|
||||
import json
|
||||
|
||||
from django.core.serializers.json import DjangoJSONEncoder
|
||||
from django.http import HttpResponse
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
from django.templatetags.static import static
|
||||
|
||||
from plinth import frontpage
|
||||
from plinth.modules import names
|
||||
|
||||
|
||||
def access_info(request, **kwargs):
|
||||
def access_info(request: HttpRequest, **kwargs) -> HttpResponse:
|
||||
"""API view to return a list of domains and types."""
|
||||
domains = [{
|
||||
'domain': domain.name,
|
||||
|
||||
Reference in new issue
Block a user