forked from enviPath/enviPy
adjusted migration
Initial bayer app Show Pack Classification Adjusted docker compose to bayer specifics Adjusted Dockerfile for Bayer Adding secret flags to group, add secret pools to packages Adjusted View for Package creation Prep configs, added Package Create Modal wip More on PES wip wip Wip minor PW interactions API PES wip Make Select Widget reflect required make required generallay available Update UI if pathway mode is set to build Added ais circle adjustments Initial Zoom, fix AD Creation wip auth log, bb4g fix missing import Added viz hint if PES is part of reaction Add Edge check for pes flip boolean ... pes Added extra ... In / Out Edges Viz, Submitting Button Text ...
This commit is contained in:
@ -389,6 +389,9 @@ def get_base_context(request, for_user=None) -> Dict[str, Any]:
|
||||
"debug": s.DEBUG,
|
||||
"external_databases": ExternalDatabase.get_databases(),
|
||||
"site_id": s.MATOMO_SITE_ID,
|
||||
# EDIT START
|
||||
"secret_groups": Group.objects.filter(secret=True),
|
||||
# EDIT END
|
||||
},
|
||||
}
|
||||
|
||||
@ -588,10 +591,38 @@ def packages(request):
|
||||
"package-description", s.DEFAULT_VALUES["description"]
|
||||
)
|
||||
|
||||
# EDIT START
|
||||
data_pool = None
|
||||
package_classification = request.POST.get("package-classification")
|
||||
classification = Package.Classification(int(package_classification))
|
||||
# For SECRET we'll need a data pool which will be an additional perm check later
|
||||
if classification == Package.Classification.SECRET:
|
||||
package_data_pool = request.POST.get("package-data-pool")
|
||||
|
||||
if package_data_pool is None:
|
||||
return error(request, "Invalid data pool.", "Data Pool is required!")
|
||||
|
||||
data_pool = GroupManager.get_group_by_url(current_user, package_data_pool)
|
||||
|
||||
if data_pool is None:
|
||||
return error(request, "Invalid data pool.", "Data Pool does not exist or no access!")
|
||||
|
||||
if not data_pool.secret:
|
||||
return error(request, "Invalid data pool.", "Data Pool is not a secret group!")
|
||||
|
||||
created_package = PackageManager.create_package(
|
||||
current_user, package_name, package_description
|
||||
)
|
||||
|
||||
created_package.classification_level = classification
|
||||
|
||||
# Set previously determined data pool
|
||||
if classification == Package.Classification.SECRET:
|
||||
created_package.data_pool = data_pool
|
||||
|
||||
created_package.save()
|
||||
# EDIT END
|
||||
|
||||
return redirect(created_package.url)
|
||||
|
||||
elif request.method == "OPTIONS":
|
||||
@ -775,13 +806,11 @@ def models(request):
|
||||
}
|
||||
|
||||
if s.ENVIFORMER_PRESENT:
|
||||
context["model_types"]["EnviFormer"] = (
|
||||
{
|
||||
"type": "enviformer",
|
||||
"requires_rule_packages": False,
|
||||
"requires_data_packages": True,
|
||||
},
|
||||
)
|
||||
context["model_types"]["EnviFormer"] = {
|
||||
"type": "enviformer",
|
||||
"requires_rule_packages": False,
|
||||
"requires_data_packages": True,
|
||||
}
|
||||
|
||||
if s.FLAGS.get("PLUGINS", False):
|
||||
for k, v in s.CLASSIFIER_PLUGINS.items():
|
||||
@ -2985,9 +3014,15 @@ def settings(request):
|
||||
new_default = request.POST.get("prediction-setting-new-default", "off") == "on"
|
||||
|
||||
# min 2, max s.DEFAULT_MAX_NUMBER_OF_NODES
|
||||
temp_max_nodes = request.POST.get("prediction-setting-max-nodes")
|
||||
if temp_max_nodes is None or temp_max_nodes == "" or int(temp_max_nodes) == -1:
|
||||
temp_max_nodes = s.DEFAULT_MAX_NUMBER_OF_NODES
|
||||
else:
|
||||
temp_max_nodes = int(request.POST.get("prediction-setting-max-nodes", 1))
|
||||
|
||||
max_nodes = min(
|
||||
max(
|
||||
int(request.POST.get("prediction-setting-max-nodes", 1)),
|
||||
temp_max_nodes,
|
||||
2,
|
||||
),
|
||||
s.DEFAULT_MAX_NUMBER_OF_NODES,
|
||||
@ -3008,6 +3043,7 @@ def settings(request):
|
||||
|
||||
model_uuid = model_url.split("/")[-1]
|
||||
params["model"] = EPModel.objects.get(uuid=model_uuid)
|
||||
# TODO Check if removed if request contains "" or not at all
|
||||
params["model_threshold"] = request.POST.get(
|
||||
"model-based-prediction-setting-threshold", s.DEFAULT_MODEL_THRESHOLD
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user