auquotidien_plugin: the category plugin should also display categories of provider which we do not have a federation with
This commit is contained in:
parent
6db2258e1f
commit
84897e6ebb
|
@ -31,10 +31,14 @@ class AuQuotidienBasePlugin(DataSourcePlugin):
|
|||
text_enabled = True
|
||||
inlines = []
|
||||
url_template = None
|
||||
with_federation_only = True
|
||||
|
||||
def get_apis(self, context, instance):
|
||||
user = context['request'].user
|
||||
return instance.apis.filter(service_provider__libertyfederation__user=user, active=True)
|
||||
if self.with_federation_only:
|
||||
return instance.apis.filter(service_provider__libertyfederation__user=user, active=True)
|
||||
else:
|
||||
return instance.apis.all()
|
||||
|
||||
def get_sources(self, context, instance):
|
||||
for api in self.get_apis(context, instance):
|
||||
|
@ -73,6 +77,7 @@ class AuQuotidienCategoryPlugin(AuQuotidienBasePlugin):
|
|||
text_enabled = True
|
||||
inlines = []
|
||||
url_template = '/categories?format=json&NameID={{{{federations.service_{provider_id}.links.0}}}}&orig={orig}'
|
||||
with_federation_only = False
|
||||
|
||||
|
||||
plugin_pool.register_plugin(AuQuotidienCategoryPlugin)
|
||||
|
|
Reference in New Issue