|
17 | 17 | Union,
|
18 | 18 | Literal,
|
19 | 19 | )
|
| 20 | + |
20 | 21 | from specifyweb.permissions.permissions import has_target_permission
|
21 | 22 | from specifyweb.specify.filter_by_col import CONCRETE_HIERARCHY
|
22 | 23 | from specifyweb.specify.models import datamodel
|
23 | 24 | from specifyweb.specify.load_datamodel import Field, Relationship, Table
|
24 | 25 | from specifyweb.specify.datamodel import is_tree_table
|
25 | 26 | from specifyweb.specify.tree_views import get_all_tree_information, TREE_INFORMATION
|
| 27 | +from specifyweb.specify.tree_utils import SPECIFY_TREES |
26 | 28 | from specifyweb.stored_queries.execution import execute
|
27 | 29 | from specifyweb.stored_queries.queryfield import QueryField, fields_from_json
|
28 | 30 | from specifyweb.stored_queries.queryfieldspec import (
|
@@ -954,10 +956,14 @@ def _to_upload_plan(rel_name: str, _self: "RowPlanCanonical"):
|
954 | 956 | ]
|
955 | 957 | all_headers = [*raw_headers, *to_one_headers, *to_many_headers]
|
956 | 958 |
|
| 959 | + def _is_anyrank_tree_relationship(name, value): |
| 960 | + return name.lower() in SPECIFY_TREES and not isinstance(value, TreeRecord) |
| 961 | + |
957 | 962 | def _relationship_is_editable(name, value):
|
958 | 963 | return (
|
959 | 964 | Func.is_not_empty(name, value)
|
960 | 965 | and name not in readonly_rels
|
| 966 | + and not _is_anyrank_tree_relationship(name, value) |
961 | 967 | and not omit_relationships
|
962 | 968 | )
|
963 | 969 |
|
|
0 commit comments