Mercurial > libervia-web
comparison libervia/pages/files/page_meta.py @ 1421:e065c8886b81
pages (files/list): set empty affiliations when they can't be retrieved
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 01 May 2021 19:04:25 +0200 |
parents | f511f8fbbf8a |
children | 106bae41f5c8 |
comparison
equal
deleted
inserted
replaced
1420:925a7c498cda | 1421:e065c8886b81 |
---|---|
1 #!/usr/bin/env python3 | 1 #!/usr/bin/env python3 |
2 | 2 |
3 | 3 |
4 from libervia.server.constants import Const as C | 4 from libervia.server.constants import Const as C |
5 from twisted.internet import defer | |
6 from twisted.words.protocols.jabber import jid | 5 from twisted.words.protocols.jabber import jid |
7 from sat.core.log import getLogger | 6 from sat.core.log import getLogger |
8 | 7 |
9 log = getLogger(__name__) | 8 log = getLogger(__name__) |
10 """files handling pages""" | 9 """files handling pages""" |
12 name = "files" | 11 name = "files" |
13 access = C.PAGES_ACCESS_PROFILE | 12 access = C.PAGES_ACCESS_PROFILE |
14 template = "file/discover.html" | 13 template = "file/discover.html" |
15 | 14 |
16 | 15 |
17 @defer.inlineCallbacks | 16 async def prepare_render(self, request): |
18 def prepare_render(self, request): | |
19 profile = self.getProfile(request) | 17 profile = self.getProfile(request) |
20 template_data = request.template_data | 18 template_data = request.template_data |
21 namespace = self.host.ns_map["fis"] | 19 namespace = self.host.ns_map["fis"] |
22 entities_services, entities_own, entities_roster = yield self.host.bridgeCall( | 20 entities_services, entities_own, entities_roster = await self.host.bridgeCall( |
23 "discoFindByFeatures", [namespace], [], False, True, True, True, False, profile | 21 "discoFindByFeatures", [namespace], [], False, True, True, True, False, profile |
24 ) | 22 ) |
25 tpl_service_entities = template_data["disco_service_entities"] = {} | 23 tpl_service_entities = template_data["disco_service_entities"] = {} |
26 tpl_own_entities = template_data["disco_own_entities"] = {} | 24 tpl_own_entities = template_data["disco_own_entities"] = {} |
27 tpl_roster_entities = template_data["disco_roster_entities"] = {} | 25 tpl_roster_entities = template_data["disco_roster_entities"] = {} |