forked from enviPath/enviPy
Merge remote-tracking branch 'origin/develop' into feature/frontend_update
This commit is contained in:
@ -240,6 +240,7 @@ def get_base_context(request, for_user=None) -> Dict[str, Any]:
|
||||
"enabled_features": s.FLAGS,
|
||||
"debug": s.DEBUG,
|
||||
"external_databases": ExternalDatabase.get_databases(),
|
||||
"site_id": s.MATOMO_SITE_ID,
|
||||
},
|
||||
}
|
||||
|
||||
@ -1869,6 +1870,25 @@ def package_pathway(request, package_uuid, pathway_uuid):
|
||||
|
||||
return response
|
||||
|
||||
if (
|
||||
request.GET.get("identify-missing-rules", False) == "true"
|
||||
and request.GET.get("rule-package") is not None
|
||||
):
|
||||
from .tasks import dispatch_eager, identify_missing_rules
|
||||
|
||||
rule_package = PackageManager.get_package_by_url(
|
||||
current_user, request.GET.get("rule-package")
|
||||
)
|
||||
res = dispatch_eager(
|
||||
current_user, identify_missing_rules, [current_pathway.pk], rule_package.pk
|
||||
)
|
||||
|
||||
filename = f"{current_pathway.name.replace(' ', '_')}_{current_pathway.uuid}.csv"
|
||||
response = HttpResponse(res, content_type="text/csv")
|
||||
response["Content-Disposition"] = f'attachment; filename="{filename}"'
|
||||
|
||||
return response
|
||||
|
||||
# Pathway d3_json() relies on a lot of related objects (Nodes, Structures, Edges, Reaction, Rules, ...)
|
||||
# we will again fetch the current pathway identified by this url, but this time together with nearly all
|
||||
# related objects
|
||||
|
||||
Reference in New Issue
Block a user